dry-cli icon indicating copy to clipboard operation
dry-cli copied to clipboard

Add command to recursively print `help`

Open cllns opened this issue 5 years ago • 4 comments

Right now, --help only goes one level deep. I think we should keep it that way, but it'd be nice to have another command that recursively prints out every command (that is, print the whole tree, including subcommands).

I could see it being useful for getting an idea of all the available commands, and also something someone could pipe to grep to find the command they're looking for.

Examples

Right now: hanami --help

Commands:
  hanami assets [SUBCOMMAND]
  hanami console                              # Starts Hanami console
  hanami db [SUBCOMMAND]
...

Proposed: hanami --help-all (Not sure what the best name would be)

Commands:
  hanami assets precompile                  # Precompile assets for deployment
  hanami console                            # Starts Hanami console
  hanami db apply                           # Migrate, dump the SQL schema, and delete the migrations (experimental)
  hanami db console                         # Starts a database console
  hanami db create                          # Create the database (only for development/test)
  hanami db drop                            # Drop the database (only for development/test)
  hanami db migrate [VERSION]               # Migrate the database
  hanami db prepare                         # Drop, create, and migrate the database (only for development/test)
  hanami db rollback [STEPS]                # Rollback migrations
  hanami db version                         # Print the current migrated version
...

Resources

This request from @unrooty https://github.com/dry-rb/dry-cli/issues/55#issuecomment-580596940 This request from @kigster https://github.com/dry-rb/dry-cli/issues/55#issuecomment-520124037

cllns avatar Feb 07 '20 21:02 cllns

I'll see if I have time to look at it... I want to.

kigster avatar Jul 22 '20 06:07 kigster

One common flag I've seen being used is --longhelp.

For instance mp3 transcoding tool lame has that flag.

kigster avatar Aug 24 '20 23:08 kigster

AHHHH, I got it wrong all the time until now. Good point. Will do that

IvanShamatov avatar Feb 09 '21 21:02 IvanShamatov

Honestly --help-all or --help-recursive or --help-commands are all decent options.

kigster avatar Mar 10 '21 22:03 kigster