You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
2 years ago
|
/*
|
||
|
FLAGOK - C/C++ command line flags library
|
||
|
Copyright (C) 2022 Kasyanov Nikolay Alexeyevich (Unbewohnte)
|
||
|
|
||
|
This program is free software: you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation, either version 3 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
#include "../src/flagok.h"
|
||
|
|
||
|
int main(int argc, char** argv) {
|
||
|
long long iteration = 1;
|
||
|
char* input = "hello";
|
||
|
bool to_do_or_not = false;
|
||
|
|
||
|
flag_int(&iteration, "-iteration", "set iterations");
|
||
|
flag_str(&input, "-input", "set input");
|
||
|
flag_bool(&to_do_or_not, "-to_do_or_not", "set true or false");
|
||
|
|
||
|
printf("Flags before parsing\n");
|
||
|
printf("iter %lld\n", iteration);
|
||
|
printf("input %s\n", input);
|
||
|
printf("todo %d\n", to_do_or_not);
|
||
|
|
||
|
flag_parse(argc, argv);
|
||
|
|
||
|
printf("Flags after parsing\n");
|
||
|
printf("iter %lld\n", iteration);
|
||
|
printf("input %s\n", input);
|
||
|
printf("todo %d\n", to_do_or_not);
|
||
|
}
|