CLI: 'tahoe $SUBCOMMAND --help' no longer shows "global" options #2233

Closed
opened 2014-04-24 17:07:49 +00:00 by daira · 9 comments
daira commented 2014-04-24 17:07:49 +00:00
Owner

For example, in Tahoe-LAFS v1.9.2:

$ bin/tahoe start --help
Usage:  tahoe start [options] [NODEDIR]
Options:
  -q, --quiet             Operate silently.
  -V, --version           Display version numbers.
      --version-and-path  Display version numbers and paths to their locations.
  -p, --profile           Run under the Python profiler, putting results in
                          'profiling_results.prof'.
      --syslog            Tell the node to log to syslog, not a file.
  -C, --basedir=          Same as --node-directory.
  -d, --node-directory=   Specify which Tahoe node directory should be used.
                          [default for most commands: 'REDACTED']
      --help              Display this help and exit.

In Tahoe-LAFS v1.10.0:

$ bin/tahoe start --help
Usage:  tahoe [global-opts] start [options] [NODEDIR]
Options:
  -p, --profile   Run under the Python profiler, putting results in
                  'profiling_results.prof'.
      --syslog    Tell the node to log to syslog, not a file.
  -C, --basedir=  Same as --node-directory (default REDACTED).
      --version   
      --help      Display this help and exit.

This appears to be a regression due to the fix for #166.

For example, in Tahoe-LAFS v1.9.2: ``` $ bin/tahoe start --help Usage: tahoe start [options] [NODEDIR] Options: -q, --quiet Operate silently. -V, --version Display version numbers. --version-and-path Display version numbers and paths to their locations. -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Same as --node-directory. -d, --node-directory= Specify which Tahoe node directory should be used. [default for most commands: 'REDACTED'] --help Display this help and exit. ``` In Tahoe-LAFS v1.10.0: ``` $ bin/tahoe start --help Usage: tahoe [global-opts] start [options] [NODEDIR] Options: -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Same as --node-directory (default REDACTED). --version --help Display this help and exit. ``` This appears to be a regression due to the fix for #166.
tahoe-lafs added the
code-frontend-cli
normal
defect
1.10.0
labels 2014-04-24 17:07:49 +00:00
tahoe-lafs added this to the soon milestone 2014-04-24 17:07:49 +00:00
daira commented 2014-04-24 17:17:07 +00:00
Author
Owner

The desired output is:

$ bin/tahoe start --help
Usage:  tahoe [global-opts] start [options] [NODEDIR]
Global options:
  -q, --quiet             Operate silently.
  -V, --version           Display version numbers.
      --version-and-path  Display version numbers and paths to their locations.
  -d, --node-directory=   Specify which Tahoe node directory should be used. The
                          directory should either contain a full Tahoe node, or
                          a file named node.url that points to some other Tahoe
                          node. It should also contain a file named
                          'private/aliases' which contains the mapping from
                          alias name to root dirnode URI. [default for most
                          commands: 'REDACTED']
Options:
  -p, --profile   Run under the Python profiler, putting results in
                  'profiling_results.prof'.
      --syslog    Tell the node to log to syslog, not a file.
  -C, --basedir=  Same as --node-directory.
      --version   
      --help      Display this help and exit.

Notice that the desired description of -d for create-* subcommands should be different:

  -d, --node-directory=   Specify an empty directory to be used for the new Tahoe node.

Also note that this has a default in the case of tahoe create-node and tahoe create-client, but not for tahoe create-key-generator or tahoe create-stats-gatherer.

The desired output is: ``` $ bin/tahoe start --help Usage: tahoe [global-opts] start [options] [NODEDIR] Global options: -q, --quiet Operate silently. -V, --version Display version numbers. --version-and-path Display version numbers and paths to their locations. -d, --node-directory= Specify which Tahoe node directory should be used. The directory should either contain a full Tahoe node, or a file named node.url that points to some other Tahoe node. It should also contain a file named 'private/aliases' which contains the mapping from alias name to root dirnode URI. [default for most commands: 'REDACTED'] Options: -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Same as --node-directory. --version --help Display this help and exit. ``` Notice that the desired description of `-d` for `create-*` subcommands should be different: ``` -d, --node-directory= Specify an empty directory to be used for the new Tahoe node. ``` Also note that this has a default in the case of `tahoe create-node` and `tahoe create-client`, but not for `tahoe create-key-generator` or `tahoe create-stats-gatherer`.
tahoe-lafs modified the milestone from soon to 1.10.1 2015-04-12 23:02:24 +00:00
daira commented 2015-04-14 16:40:00 +00:00
Author
Owner

This is not a blocker for 1.10.1, just a nice-to-have.

This is not a blocker for 1.10.1, just a nice-to-have.

Hm, does it really need to do this? I think that could get a bit noisy, to have those same global opts on every command. Git doesn't do it that way.

How about a single line that points to tahoe --help to get the global options, like:

$ bin/tahoe start --help
Usage:  tahoe [global-opts] start [options] [NODEDIR]
(use 'tahoe --help' to view global options)

Options:
  -p, --profile   Run under the Python profiler, putting results in
                  'profiling_results.prof'.
      --syslog    Tell the node to log to syslog, not a file.
  -C, --basedir=  Same as --node-directory.
      --version   
      --help      Display this help and exit.

but maybe we inline the global-opts on just the create-* subcommands, to emphasize how -d is different there:

$ ./bin/tahoe create-node --help
Usage: tahoe [global-opts] create-node [options] [NODEDIR]

Global options:
  -q, --quiet             Operate silently.
  -V, --version           Display version numbers.
      --version-and-path  Display version numbers and paths to their locations.
  -d, --node-directory=   Specify an empty directory to be used for the new
                          Tahoe node.
      --help              Display this help and exit.

Options:
      --no-storage   Do not offer storage service to other nodes.
  -C, --basedir=     Specify which Tahoe base directory should be used.
                     [default: '/Users/warner/.tahoe']
  -n, --nickname=    Specify the nickname for this node.
  -i, --introducer=  Specify the introducer FURL to use.
  -p, --webport=     Specify which TCP port to run the HTTP interface on. Use
                     'none' to disable. [default: tcp:3456:interface=127.0.0.1]
      --version
      --help         Display this help and exit.
Hm, does it really need to do this? I think that could get a bit noisy, to have those same global opts on every command. Git doesn't do it that way. How about a single line that points to `tahoe --help` to get the global options, like: ``` $ bin/tahoe start --help Usage: tahoe [global-opts] start [options] [NODEDIR] (use 'tahoe --help' to view global options) Options: -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Same as --node-directory. --version --help Display this help and exit. ``` but maybe we inline the global-opts on just the `create-*` subcommands, to emphasize how `-d` is different there: ``` $ ./bin/tahoe create-node --help Usage: tahoe [global-opts] create-node [options] [NODEDIR] Global options: -q, --quiet Operate silently. -V, --version Display version numbers. --version-and-path Display version numbers and paths to their locations. -d, --node-directory= Specify an empty directory to be used for the new Tahoe node. --help Display this help and exit. Options: --no-storage Do not offer storage service to other nodes. -C, --basedir= Specify which Tahoe base directory should be used. [default: '/Users/warner/.tahoe'] -n, --nickname= Specify the nickname for this node. -i, --introducer= Specify the introducer FURL to use. -p, --webport= Specify which TCP port to run the HTTP interface on. Use 'none' to disable. [default: tcp:3456:interface=127.0.0.1] --version --help Display this help and exit. ```
daira commented 2015-05-09 23:46:36 +00:00
Author
Owner

Hmm. The description "Same as --node-directory." for -C doesn't make sense unless --node-directory is described. I think I'd prefer it as it is in comment:94981, TBH.

Hmm. The description "`Same as --node-directory.`" for `-C` doesn't make sense unless `--node-directory` is described. I think I'd prefer it as it is in [comment:94981](/tahoe-lafs/trac-2024-07-25/issues/2233#issuecomment-94981), TBH.

What it we removed that "same as" reference?:

$ bin/tahoe start --help
Usage:  tahoe [global-opts] start [options] [NODEDIR]
(use 'tahoe --help' to view global options)

Options:
  -p, --profile   Run under the Python profiler, putting results in
                  'profiling_results.prof'.
      --syslog    Tell the node to log to syslog, not a file.
  -C, --basedir=  Specify which Tahoe base directory should be used.
                  [default: '/Users/warner/.tahoe']. Overrides any
                  global --basedir option.
      --version   
      --help      Display this help and exit.
What it we removed that "same as" reference?: ``` $ bin/tahoe start --help Usage: tahoe [global-opts] start [options] [NODEDIR] (use 'tahoe --help' to view global options) Options: -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Specify which Tahoe base directory should be used. [default: '/Users/warner/.tahoe']. Overrides any global --basedir option. --version --help Display this help and exit. ```
daira commented 2015-05-13 14:53:41 +00:00
Author
Owner

It is not the case that --basedir= overrides --node-directory=; only one may be present.

Better would be:

$ bin/tahoe start --help
Usage:  tahoe [global-opts] start [options] [NODEDIR]
(use 'tahoe --help' to view global options)

Options:
  -p, --profile   Run under the Python profiler, putting results in
                  'profiling_results.prof'.
      --syslog    Tell the node to log to syslog, not a file.
  -C, --basedir=  Specify which Tahoe base directory should be used.
                  [default: '/Users/warner/.tahoe']. This has the same
                  effect as the global --node-directory option.
      --version   
      --help      Display this help and exit.
It is not the case that `--basedir=` overrides `--node-directory=`; only one may be present. Better would be: ``` $ bin/tahoe start --help Usage: tahoe [global-opts] start [options] [NODEDIR] (use 'tahoe --help' to view global options) Options: -p, --profile Run under the Python profiler, putting results in 'profiling_results.prof'. --syslog Tell the node to log to syslog, not a file. -C, --basedir= Specify which Tahoe base directory should be used. [default: '/Users/warner/.tahoe']. This has the same effect as the global --node-directory option. --version --help Display this help and exit. ```
PR ready for review in <https://github.com/tahoe-lafs/tahoe-lafs/pull/168>
daira commented 2015-05-26 17:59:51 +00:00
Author
Owner

LGTM.

LGTM.
Brian Warner <warner@lothar.com> commented 2015-05-26 20:24:12 +00:00
Author
Owner

In /tahoe-lafs/trac-2024-07-25/commit/9d6003357da3eab8106269a022f4a615d52b0f8b:

Merge branch 'globalopts2'

Improves CLI rendering of --help for global options. Closes ticket:2233.
In [/tahoe-lafs/trac-2024-07-25/commit/9d6003357da3eab8106269a022f4a615d52b0f8b](/tahoe-lafs/trac-2024-07-25/commit/9d6003357da3eab8106269a022f4a615d52b0f8b): ``` Merge branch 'globalopts2' Improves CLI rendering of --help for global options. Closes ticket:2233. ```
tahoe-lafs added the
fixed
label 2015-05-26 20:24:12 +00:00
Brian Warner <warner@lothar.com> closed this issue 2015-05-26 20:24:12 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#2233
No description provided.