docs.rs failed to build d2o-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
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.
Installation
From Source
The release binary will be at target/release/d2o
Pre-compiled Binary
Copy the binary to your PATH:
Using Cargo
Using cargo-binstall
Completions are also available for bash, zsh, fish, powershell, elvish and nushell:
Manpages are in tarballs and zips in releases.
Usage
Generate shell completion
# 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 as JSON
# Export CLI info as JSON
d2o --command ls --format json
# Pretty-print JSON output
d2o --command curl --format json | jq .
Parse local file
# Save man page to file first
man grep | col -bx > grep.txt
# Parse from file
d2o --file grep.txt --format fish > grep.fish
Advanced options
# 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
Building
# Debug build
# Release build with optimizations
Running with verbose output
RUST_LOG=debug
Known Limitations
- Subcommand depth must be specified (default: 1 level)
- Some highly unusual help text formats may not parse perfectly
- Unicode box-drawing characters in help text are converted to ASCII
Related Projects
License
MIT - See LICENSE file
Contributing
Contributions welcome! Areas for improvement:
- Performance optimizations
- Additional help text format support
- More comprehensive testing
- Documentation