Network Docopt
Project description
network-docopt
NetworkDocopt is a command line argument parser for networking focused applications. This was heavily inspired by the docopt module at http://docopt.org/ (no code from docopt was used however). The key differences are:
Support for partial command line options. If your program foo has a “foo show summary” option you can also enter “foo sh sum”
Support for integration into bash’s auto-complete mechanism
Example
See network-docopt-example for an example of how to use this module
For bash <tab> auto-completion and bash <tab><tab> “show me available options” you must create a small bash script in /usr/share/bash-completion/completions/ like so:
cp completions/network-docopt-example /usr/share/bash-completion/completions/
This bash script will call network-docopt-example with ‘options’ as the last argument. For instance if you type “network-docopt-example show ip “ the bash script will call “network-docopt-example show ip options” which will return “route” and “interface”. This tells bash what the next options are.
Contributing
Fork it.
Create your feature branch (git checkout -b my-new-feature).
Commit your changes (git commit -am 'Add some feature').
Push to the branch (git push origin my-new-feature).
Create new Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for network_docopt-0.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b69fa196fbb2e99d8436af3f4b0ce5aa0e3615c9e604d03b4daabe0f66ada6b3 |
|
MD5 | 4eb6794dafa3ec9cbe123e545aa2ff3f |
|
BLAKE2b-256 | 9f80101ec2fead3f57712bf5577d4f5fff22c9f782b87386fcfab961646c5880 |