| Crates.io | d2o |
| lib.rs | d2o |
| version | 0.1.0 |
| created_at | 2025-11-30 09:07:14.32426+00 |
| updated_at | 2025-11-30 09:07:14.32426+00 |
| description | Help to Options - Parse help or manpage texts and generate shell completion scripts |
| homepage | |
| repository | https://github.com/MuntasirSZN/d2o |
| max_upload_size | |
| id | 1958039 |
| size | 473,111 |
d2o
A high-performance, pure Rust rewrite of h2o - a CLI tool that extracts command-line options from help text and man pages, then exports them as shell completion scripts or JSON.
cd /home/muntasir/projects/d2o
cargo build --release
./target/release/d2o --help
The release binary will be at target/release/d2o
Copy the binary to your PATH:
cp target/release/d2o ~/.local/bin/
cargo install d2o
cargo-binstallcargo binstall d2o
Completions are also available for bash, zsh, fish, powershell, elvish and nushell:
d2o --completions <shell> # Replace <shell> with your shell name
Manpages are in tarballs and zips in releases.
# Generate fish completion script from `man ls` or `ls --help`
d2o --command ls --format fish > ls.fish
# Generate zsh completion script
d2o --command git --format zsh > git.zsh
# Generate bash completion script (plain options only)
d2o --command docker --format bash > docker.bash
# Generate bash completion script compatible with bash-completion (includes descriptions)
d2o --command docker --format bash --bash-completion-compat > docker.bash
# Export CLI info as JSON
d2o --command ls --format json
# Pretty-print JSON output
d2o --command curl --format json | jq .
# Save man page to file first
man grep | col -bx > grep.txt
# Parse from file
d2o --file grep.txt --format fish > grep.fish
# Skip man page lookup (use --help only)
d2o --command cargo --skip-man --format json
# List subcommands
d2o --command git --list-subcommands
# Extract subcommand options
d2o --subcommand git-log --format fish
# Preprocess only (debug option splitting)
d2o --command ls --preprocess-only
# Scan deeper for nested subcommands
d2o --command docker --depth 2 --format json
# Debug build
cargo build
# Release build with optimizations
cargo build --release
RUST_LOG=debug ./target/release/d2o --command ls --format json
MIT - See LICENSE file
Contributions welcome! Areas for improvement: