Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline help improvement #3

Open
gilcot opened this issue Apr 12, 2017 · 1 comment
Open

inline help improvement #3

gilcot opened this issue Apr 12, 2017 · 1 comment
Assignees

Comments

@gilcot
Copy link

gilcot commented Apr 12, 2017

Hello,

Currently, in interactive/shell use, when I type help it says:

Documented commands (type help ):

config get

Undocumented commands:

exit help quit

The command help can easily be documented so:

usage: help [command]
or: command --help

Show usage of a command.
Without any command, show this help

Documented commands:
config For working with this tool's configuration
help Showing this message
get For retrieving information from phpIPAM

Undocumented commands:
exit Ends interactive session
quit Ends interactive session

Now, for config and get commands, there are some corrections needed.
Let's look at the first one, when I issue a help config

Usage: config [OPTIONS] COMMAND [ARGS]...

Commands for working with this tool's stored configuration.
Must be called with a subcommand.

Options:
--help Show this message and exit.

Commands:
get-url Show the currently configured phpIPAM URL to...
set-url Specify a new phpIPAM URL for the tool to...

But, there's only one option and this one has precedence over everything.
By then, config --help blah or just config --help gives the same result!
Also, there's said that it "must be called with a subcommand."..
So, I suggest rewriting the help that way:

Usage: config SUBCOMMAND [URL]
config --help

Subcommands for working with this tool's stored configuration.

--help Show this message and exit.

Subcommands:
get-url Show the currently configured phpIPAM URL to...
set-url Specify a new phpIPAM URL for the tool to...

Of course, the current presentation is not wrong, except there's only one option:

Usage: config [--help] SUBCOMMAND [URL]

Subcommands for working with this tool's stored configuration.

--help Show this message and exit.

Subcommands:
get-url Show the currently configured phpIPAM URL to...
set-url Specify a new phpIPAM URL for the tool to...

Better, we may avoid mentionning the common option everytime:

Usage: config SUBCOMMAND [URL]

Subcommands for working with this tool's stored configuration.

Subcommands:
get-url Show the currently configured phpIPAM URL to...
set-url Specify a new phpIPAM URL for the tool to...

Notice the use of URL instead of less explicit ARGS (and confusing too because there's only one)
Same thing when issuing get --help or help get (here, use KEYWORD instead of ARGS...)

Usage: get SUBCOMMAND KEYWORD

Subcommands to retrieve info from phpIPAM.
KEYWORD is a part of the hostname, case insensitive.

Subcommands:
all Search all available sources in phpIPAM
device Search the Devices page
search Search the 'IP Addresses' list;
KEYWORD may be begin of IP and star

Regards.

@alextremblay
Copy link
Owner

Hello again, thanks for the feedback!

the command-line interface for this application was made with a CLI framework that has a somewhat tricky help system. Ill play around with it when I get some time and see what I can do about making it more clear and concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants