Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Show only immediate child commands in help text #3828

Open
aboodman opened this issue Feb 1, 2019 · 0 comments
Open

Show only immediate child commands in help text #3828

aboodman opened this issue Feb 1, 2019 · 0 comments

Comments

@aboodman
Copy link
Contributor

aboodman commented Feb 1, 2019

The help text for the noms command is getting pretty hairy because of all the nested subcommands for things like noms struct and noms list.

Kingpin has a builtin ability to provide different templates (via UsageTemplate()) and one of them is more compact:

Commands:
  help [<command>...]
  commit [<flags>] [<absolute-path>] [<database>]
  config
  diff [<flags>] <object1> <object2>
  ds [<flags>] [<database>]
  log [<flags>] <path-spec>
  merge [<flags>] <database> <left-dataset-name> <right-dataset-name> <output-dataset-name>
  root [<flags>] <database>
  serve [<flags>] <database>
  show [<flags>] <object>
  sync [<flags>] <source-object> <dest-dataset>
  version
  blob
    put [<flags>] <file> <dataset>
    export <dataset> [<file>]
  list
    new <database> [<items>...]
    append <spec> [<items>...]
    insert <pos> <spec> [<items>...]
    del <spec> <pos> <len>
  map
    new <database> [<entries>...]
    set <spec> [<entries>...]
    del <spec> [<keys>...]
  set
    new <database> [<items>...]
    insert <spec> [<items>...]
    del <spec> [<items>...]
  stats <database>
  struct
    new [<flags>] <database> [<fields>...]
    set <spec> [<fields>...]
    del <spec> [<fields>...]
  splore [<flags>] <database or path>

... but it still seems like a bit much. Plus that template elides the short summary of what each top-level command does, which is useful.

I think we should instead create a new template that just omits the nested commands. This is what other things I have seen that have deep command hierarchies do.

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

No branches or pull requests

1 participant