Skip to content
/ cla Public

Header-only Library for Command Line Argument Parsing (Under Development)

License

Notifications You must be signed in to change notification settings

ryu-min/cla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CLA - Header-only Library for Command Line Argument Parsing (Under Development)

Library description

This is a header-only library for parsing command line arguments in C++. It provides an easy-to-use interface for registering and accessing command line arguments Note: This library is currently under development and not ready for use.

Usage

To use this library, include the parser.h header file in your C++ project.

Usage example:

#include <cla/parser.h>
#include <iostream>

using namespace cla;

int main(int argc, char **argv)
{
    std::string stringValue;
    int intValue;
    double doubleValue;

    parser()
            .addRequired("string", 's', stringValue, "some description")
            .addRequired("int", 'i', intValue,"some description")
            .addRequired("double", 'd', doubleValue, "some description")
            .parse(argc, argv);
    
    std::cout << "string arg value is " << stringValue  << std::endl;
    std::cout << "int arg value is "    << intValue     << std::endl;
    std::cout << "double arg value is " << doubleValue  << std::endl;
    return 0;
}

About

Header-only Library for Command Line Argument Parsing (Under Development)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published