Skip to content

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
  1. Getting Started — install the library, run the first sample, and learn the minimum parser flow
  2. AI agent guide — ownership, cleanup order, and wrapper-CLI parsing policy
  3. Guides — dive into features as you need them
  4. Basic usage
  5. Options and types
  6. nargs
  7. Subcommands
  8. Completion callbacks
  9. known args / unknown args
  10. fromfile_prefix_chars
  11. Reference
  12. API Reference (English)
  13. 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

Need Japanese docs?