← All repos

clap4shell

Standalone wrapper of clap for shell scripts

options-parsingrustshell-script
Browse cluster: Haskell tooling and libraries
45commits
2contributors
3languages

Tech stack & purpose

clap4shell is a standalone wrapper around the Rust clap library that brings clap's argument parsing capabilities to shell scripts. It takes option descriptors defined in YAML format from stdin and outputs parsed results as newline-delimited key=value pairs suitable for eval in shell code, effectively serving as a modern replacement for getopt. The project is built in Rust and includes features like subcommand support, value validation through possible_values, and shell completion script generation for bash and zsh. The tool was created by Fumiaki Kinoshita and can be installed via Nix.

Languages

Rust
58.7%
Nix
25.0%
Shell
16.3%

Contributors