#arguments-parser #text-parser #help #command-line-arguments #tree #constructing #obligatory

no-std docopticon

An argument-parser based on the obligatory help-text

3 releases

0.1.2 Jan 15, 2024
0.1.1 Jan 14, 2024
0.1.0 Jan 13, 2024

#2 in #constructing

Download history 5/week @ 2024-01-09 1/week @ 2024-01-16 1/week @ 2024-02-13 10/week @ 2024-02-20 19/week @ 2024-02-27 2/week @ 2024-03-12 9/week @ 2024-03-26 42/week @ 2024-04-02

51 downloads per month

LGPL-3.0

67KB
1K SLoC

docopticon

docopticon is yet-another argument parsing library for Rust, however, this one relies upon constructing the argument tree from the actual help text that every command-line program should have. This is instead of generating the help for every argument.

Example

use docopticon;
???
profit

TODO

Stuff I need to write:

Parsers

  • usage-option
  • usage-parameter
  • usage-optional-parameters () {} []
  • default-in-description () {} []
  • stdin - and parameter flag --
  • slices / ranges of values a..b
  • multiple choice parameters

Argument Tree

  • option levels
  • associated function?

Features

  • Compile-time generation of an argument tree from a given Usage string slice.
  • no_std - only depends on libc and Rust's core library.
  • Does not require an allocator - could potentially work on embedded targets.
  • Also includes a set of functions to allow for XDG-dirs compliant saving/loading of configuration, state and data files.

Docopt

docopt is a standard that is vaguely defined by the docopt team behind the initial Python library. This library attempts to be more rigorous in the definition of the core protocol but still allowing for some flexibility when it comes to how you write your Usage: text.

Credits

Dependencies

~180KB