Skip to content

ZackeryRSmith/Cclarg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



logo


    Cclargs

A minimalistic C library for intuitive command line argument parsing. Designed for simplicity, built for functionality.
Report Bug · Request a Feature · Example Code

Features




Features

Intuitive Parsing

cclarg is built to simplify the process of command line argument parsing. No need to wrestle with parsing yourself. Incorporate the library and let it handle the intricacies for you

int main(int argc, char *argv[]) {
    parse_args(argc, argv, ...);
    ...
}

Flag Support

Supporting both short and long flag formats, cclarg is flexible to your needs. Whether you prefer -h or --help, or even attaching values directly like -f=filename and --file=filename or even -f filename and --file filename , the library has got you covered.

Flag flags[] = {
    {"-h", "--help", "Show help menu", ...},
    {"-f", "--file", "Specify file", ...}
};

Positional Argument Support

Beyond flags, cclarg allows capturing position-based arguments with ease. Whether it's a filename, an operation, or a series of inputs, positionals can be defined to capture them.

Positional positionals[] = {
    {"filename", "Name of the file", ...}
};

Auto-generating Help Menu

One of cclarg's helpful features is the automated help menu, designed (roughly) in line with GNU standards. With just a function call, get a help menu tailored to your flags and positionals.

if (flags[HELP_FLAG].is_set) {
    print_help(...);
}

Error Handling

Errors are a part of life. With cclarg parsing returns clear error codes for invalid flags, missing values, or unexpected arguments.

Lightweight and Single Header-only

With a focus on simplicity, cclarg is a header-only library. No need for weird installations or additional dependencies.

#include "cclarg.h"

Fair warning

Cclarg was designed with a very simple goal in mind, a extremly light and intuitive command line argument parser. To keep it this way, many features you may find in larger libraries aren't here.

If you find a feature absolutly nessasary for command line development that I've missed, please request it as a feature.

About

A minimalistic C library for intuitive command line argument parsing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages