dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Help for subcommands is difficult to read #63

Closed fiatjaf closed 8 years ago

fiatjaf commented 8 years ago

My journey trying to read the help for my own subcommands:

app~$ help

  Commands:

    help [command]    Provides help for a given command.
    exit [options]    Exits instance of Vorpal.

  Command Groups:

    type *            2 sub-commands.
    record *          3 sub-commands.

app~$ record

  Command Groups:

    record add *  3 sub-commands.

app~$ help record

  Command Groups:

    record add *  3 sub-commands.

app~$ help record add

  Command Groups:

    record add *  3 sub-commands.

app~$ record help add

  Invalid Command. Showing Help:

  Commands:

    help [command]    Provides help for a given command.
    exit [options]    Exits instance of Vorpal.
    repl              Enters REPL mode.
    erase [options]   erases db

  Command Groups:

    type *            2 sub-commands.
    record *          3 sub-commands.

I still don't know how to do it, but perhaps vorpal shouldn't group the help for commands below a threshold? Maybe if the command group does not have more than 5 commands grouped than the help for them all will be shown on help? Perhaps this number is configurable? Or, better, we should have to group commands explicitly (or maybe we could ungroup explicitly)?

dthree commented 8 years ago

I've been thinking that too. I really don't like how it is currently.

Perhaps it only does that if the length of the help is greater than the screen height? How does that sound?

fiatjaf commented 8 years ago

Is that possible? Sounds like an awesome solution.

dthree commented 8 years ago

Yeah should be pretty easy.

fiatjaf commented 8 years ago

Meanwhile, how do I read the help for these subgrouped commands? Should I ask this on StackOverflow?

dthree commented 8 years ago

Yeah - that would be a good SO question. But quick answer:

help [command]

such as:

help type

dthree commented 8 years ago

Any reason you closed this? I still would like to implement this!

fiatjaf commented 8 years ago

I related this to https://github.com/dthree/vorpal/issues/66 in my mind, and thought they were treating of the same issue, but now that I reread what I had written I see this is a totally different issue.

dthree commented 8 years ago

Okay cool.

dthree commented 8 years ago

Your journey is over. Fixed in v1.10.5.

AdrieanKhisbe commented 6 years ago

@dthree Is it possible to customize the text attached to one command group?

I mean, Instead of

Command Groups:

    type *            2 sub-commands.
    record *          3 sub-commands.

having

Command Groups:

    type *            Relative commands to type. (2 sub-commands.)
    record *        Perform operations on records . (3 sub-commands.)

(tell me if it's better to open a new issue)