argparse-c¶
Build C99 command-line tools with a Python argparse-style authoring experience.
argparse-c is for developers who want more than basic flag parsing: completion, manpage generation, subcommands, nargs, and known-args parsing are all available from the same parser definition.
Why start here?¶
Use this site when you want to:
- install the library from source or release assets
- copy a minimal CLI example and then expand it
- add completion or manpage generation without inventing custom plumbing
- look up the exact API contract after learning the basics
Recommended reading order¶
- Getting Started — install the library, run the first sample, and learn the minimum parser flow
- AI agent guide — ownership, cleanup order, and wrapper-CLI parsing policy
- Guides — dive into features as you need them
- Basic usage
- Options and types
- nargs
- Subcommands
- Completion callbacks
- known args / unknown args
- fromfile_prefix_chars
- Reference
- API Reference (English)
- FAQ
What you can build quickly¶
- a single-command CLI with required flags and positional inputs
- a nested subcommand CLI
- a wrapper command that forwards unknown arguments via
ap_parse_known_args(...) - a CLI that emits bash/fish completion scripts and a manpage
Example programs in this repository¶
sample/example1.c— minimal parse/validate/read flowsample/example_completion.c— completion and manpage generator entrypointssample/example_subcommands.c— nested subcommands andsubcommand_path