A feature-rich command line argument parser for Lua inspired by Python's argparse.
Argparse is a command-line argument parsing library for Lua that enables developers to easily define, validate, and parse command-line arguments for their scripts and applications. It provides a declarative API for specifying arguments, options, and flags, automatically generating help text and error messages to improve user experience.
Lua developers and script authors who need to build command-line interfaces with complex argument structures, validation, and user-friendly help systems.
Developers choose Argparse for its Python-inspired design, comprehensive feature set, and automatic help/error generation, which reduces boilerplate and ensures consistent, professional CLI behavior across Lua tools.
Feature-rich command line parser for Lua
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles positional arguments, options, flags, and subcommands with features like repeatable options and count modifiers, as shown in the example with `-I` include locations.
Generates detailed usage and help messages automatically based on argument definitions, reducing boilerplate and ensuring consistent CLI interfaces, demonstrated in the help output for the example script.
Provides clear error feedback with suggestions for typos, such as 'Did you mean '--output'?', enhancing user experience during command-line input errors.
Supports short and long option formats, default values, and structured output tables, making it easy to integrate complex argument parsing into Lua scripts with minimal code.
The tutorial is hosted online, and offline access requires building documentation with Sphinx, adding an extra step for developers without internet connectivity.
For basic scripts with minimal argument parsing, the library introduces unnecessary complexity and overhead compared to manual parsing using Lua's native `arg` table.
It is designed exclusively for Lua, making it unsuitable for multi-language projects or environments where cross-platform CLI tools in other languages are needed.