Skip to content

nicolaszmarzagao/argument-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

argument-parser

A small command-line argument parser written in C.

This project is mostly for personal use and education. The goal is to build a minimal CLI parser from scratch to better understand how argument parsing, validation, and simple library design work in C.

The name argument-parser is temporary and may change later.

Goal

The main goal is to create a small but usable parser that can:

  • create a parser configuration
  • register flags
  • parse argc and argv
  • store parsed flag values
  • validate common user input errors
  • retrieve values from parsed flags

TODO List

  • Create parser config

    • name
    • version
    • description
  • Register flags

    • flag name
    • type
    • required/optional
  • Parse argc / argv

  • Store parsed flag values

  • Validate errors #2

    • unknown flag
    • missing value
    • invalid type
    • missing required flag
  • Retrieve values #1

  • Return error codes

  • Print basic error/help message

Planned Features

The first version will stay intentionally small. More advanced CLI features may be added later, such as:

  • short flags
  • default values
  • automatic help output
  • positional arguments
  • --flag=value syntax
  • subcommands

About

Minimal C argument parser library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors