A Rust command line argument parser that uses a documentation string to define the interface.
docopt.rs is a command-line argument parser for Rust that implements the Docopt language. It allows developers to define their command-line interface by writing a usage pattern in their program's documentation, which is then automatically parsed to handle arguments. This approach ensures the help text and argument parsing logic are always consistent.
Rust developers building command-line applications who want a declarative, documentation-driven approach to argument parsing, especially those familiar with or preferring the Docopt pattern from other languages.
Developers choose docopt.rs for its unique documentation-first design, which reduces duplication and keeps help text accurate. Its automatic type decoding via Serde provides convenience and type safety, while still offering a traditional lower-level API for manual control.
Docopt for Rust (command line argument parser).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the Docopt language, allowing CLI interfaces to be defined directly in documentation strings, ensuring help text and parsing logic stay in sync as per the project philosophy.
Integrates with Serde for automatic deserialization of parsed arguments into strongly-typed Rust structs, reducing boilerplate and enhancing type safety.
Includes a `docopt-wordlist` tool and shell completions to assist with command-line tab completion, though setup is described as hacky and limited.
Provides a lower-level `ArgvMap` for manual type conversion, matching the reference Python implementation for those preferring direct hash table access.
The README explicitly states the crate is unmaintained and unlikely to evolve, with the wider Docopt project also mostly unmaintained, making it risky for long-term use.
Admits to significant issues including lack of `OsStr` support for OS-specific strings and severe performance problems in not-uncommon edge cases, hindering reliability.
Recommends alternatives like clap or structopt, indicating a stagnant community and fewer resources compared to actively maintained Rust CLI parsers.