Command-line applications

From Rust Community Wiki
Jump to navigation Jump to search

Argument Parsing[edit | edit source]

Libraries[edit | edit source]

Crate Maintenance status Non-UTF8 arguments Macro-based interface definition Notes
Cargo vec.svgargh Actively developed no[1] yes Made by Google. "Optimized for code size".
Cargo vec.svgclap Actively developed yes Only on 3.0.0 beta The gold standard for argument parsing in Rust. Includes Cargo vec.svgstructopt in the 3.0.0 beta.
Cargo vec.svgdocopt Passively maintained no no Based on the docopt "command-line interface description language". Relies on Cargo vec.svgserde to deserialize parts of the input string into more concrete types.
Cargo vec.svggetopts Passively maintained no no
Cargo vec.svggumdrop Actively developed no[2] yes
Cargo vec.svgpico-args Actively developed yes no pico-args' main value proposition is its complete lack of dependencies and its tiny size when compiled into your program.
Cargo vec.svgstructopt Actively developed yes yes Provides a custom derive-mode macro which lets you define the interface by defining and annotating a struct. structopt was the first crate to provide this functionality. Uses Cargo vec.svgclap under the hood.

Other[edit | edit source]

References[edit | edit source]

  1. google/argh#33 Supporting non-UTF-8 paths
  2. murarth/gumdrop#15 Documentation should mention how to accept filenames as arguments.