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.
Kasianov Nikolai Alekseevich
f4c6ef8cb2
|
2 years ago | |
---|---|---|
src | 2 years ago | |
testing | 2 years ago | |
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
Makefile | 2 years ago | |
README.md | 2 years ago |
README.md
flagok (флажок) - C/C++ command line flags library
Installation
git clone https://unbewohnte.su:3000/Unbewohnte/flagok.git
- Either
make static
|make
to make a static|shared library (if you have make and other *NIX utilities) or simply put header file into your project and compile it your own way
Usage
Each flag has its name
, value
, description
and
flag_bool
(bool)flag_int
(long long)flag_uint
(unsigned long long)flag_double
(long double)flag_string
(char*)
are available to be called
Example:
long long int_value = 1;
char* string_value = "hello";
bool bool_value = false;
flag_int(&int_value, "-intval", "set int");
flag_str(&string_value, "-stringval", "set string");
flag_bool(&bool_value, "-boolval", "set true or false");
flag_parse(argc, argv);
-help
flag is set automatically and when presented, prints all registered flags' information to stdout
Right now the parsing process is not strict and does not output any errors. When for example the argument to integer flag was not provided - the parse function will simply move on onto the next argument and leave the current value untouched.
License
LGPLv3