Skip to content

ajaykrishna97/gen_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gen_cli

generic CLI with easy configurabilty for windows and Linux made in C.

Simple to configure a new command or page to the command line interface module. Works with input from STDIO. Compatible with Linux ,windows and Android native.

Building

mkdir build 
cd build 

cmake ../
make

NOTE: for MIN GW in windows use the following command
cmake -G "MinGW Makefiles" ../
make

API Usage

  • To add a new command use the below macro
    COMMAND(COMMAND_NAME, EXPECTED_ARGUMENT_COUNT, HELP_STRING, ADVANCED_HELP)

  • Each command must have its own command function which will be triggered when the command is entered by the user
    CMDFUNC(COMMAND_NAME)

  • To add a new page use the below macro
    PAGE(PAGE_NAME, PAGE_HELP_STRING, POINTER_TO_PAGE)

  • Check example for sample API usage.

Sample screenshots

License

Distributed under the Apache-2.0 License. See LICENSE for more information.