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

Description for command which is set as default is not shown #60

Open
kdeme opened this issue Oct 14, 2022 · 0 comments
Open

Description for command which is set as default is not shown #60

kdeme opened this issue Oct 14, 2022 · 0 comments

Comments

@kdeme
Copy link
Contributor

kdeme commented Oct 14, 2022

The description for the command which is set as default is not shown when doing --help.
It is only shown when doing <command name> --help.

Snippet:

import
  confutils

type
  ExporterCmd* = enum
    exportCommand =
      "Some very important description, must read this!"
    printCommand =
      "Some description"

  ExporterConf* = object
    case cmd* {.
      command
      defaultValue: exportCommand .}: ExporterCmd
    of exportCommand:
      port* {.
        defaultValue: 1
        desc: "some port"
        name: "port" .}: uint16
    of printCommand:
      portP* {.
        defaultValue: 1
        desc: "some port"
        name: "port" .}: uint16

when isMainModule:
  let config = ExporterConf.load()

No important description to be seen:

$ ./test_conf --help
Usage: 

test_conf command
 --port  some port [=1].

Available sub-commands:

test_conf printCommand [OPTIONS]...

Some description.

The following options are available:

 --port  some port [=1].

Only seen when specifically using the command:

$ ./test_conf exportCommand --help
Usage: 

test_conf exportCommand [OPTIONS]...

Some very important description, must read this!.

The following options are available:

 --port      some port [=1].

And when removing the default:

./test_conf --help
Usage: 

test_conf command

Available sub-commands:

test_conf exportCommand [OPTIONS]...

Some very important description, must read this!.

The following options are available:

 --port  some port [=1].

test_conf printCommand [OPTIONS]...

Some description.

The following options are available:

 --port  some port [=1].
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