C/C++ command line flags library
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 README 2 years ago
src initial commit 2 years ago
testing README 2 years ago
.gitignore initial commit 2 years ago
LICENSE initial commit 2 years ago
Makefile initial commit 2 years ago
README.md README 2 years ago

README.md

flagok (флажок) - C/C++ command line flags library

Installation

  1. git clone https://unbewohnte.su:3000/Unbewohnte/flagok.git
  2. 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