New issue
Advanced search Search tips

Issue 786176 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

logdog help doesn't list -help as an option, and vice-versa

Project Member Reported by brucedaw...@chromium.org, Nov 16 2017

Issue description

logdog has both "help" and "-help" commands. Neither help command lists the other which means it is easy to only find half of the options. Either both commands should list the other or, better yet, both commands should list all of the options.

Failure to specify a leading '-' meant that I failed to discover the very important -timeout command.
 
Cc: mar...@chromium.org
Owner: mar...@chromium.org
Status: Assigned (was: Untriaged)
Code is here: https://chromium.googlesource.com/infra/luci/luci-go/+/master/logdog/client/cli/main.go

but I don't see anything configurable at the application level, maybe it's something we need to add to maruel's subcommand module.

maruel, what do you think?

Comment 2 by mar...@chromium.org, Mar 13 2018

The idea is that if you want help for a subcommand, you can do:

logdog cat -help
or
logdog help cat

This is similar to own the gcloud tool help works (but subcommands predates gcloud)

Sure, I can see the point in having the two help commands. But it seems like there is a discoverability problem. If I run "logdog" with no arguments it prints the usage, which includes "help". Running "logdog help" prints the same information.

Meanwhile, "logdog -help" lists -host, -insecure, -log-level, -project, -service-account-json, and -timeout. My point is that these arguments are undiscoverable. If "-help" was added to the information printed by "help", or if "help" printed the information which "-help" prints then these options would be discoverable.

The concrete problem is that I *needed* the -timeout command but I could not find it without asking a person for assistance. Here's the output I'm seeing:


> logdog.exe help
LogDog log data access CLI

Usage:  logdog [command] [arguments]

Commands:
  help         prints help about a command
  cat          Write log stream to STDOUT.
  query        Query for log streams.
  latest       Write the latest full log record in a stream to STDOUT.
  auth-login   performs interactive login flow
  auth-logout  removes cached credentials
  auth-info    prints an email address associated with currently cached token


Use "logdog help [command]" for more information about a command.


> logdog.exe -help
Usage:
  -host string
        The LogDog Coordinator [host][:port]. (default "luci-logdog.appspot.com")
  -insecure
        Use insecure transport for RPC.
  -log-level value
        The logging level. Valid options are: debug, info, warning, error. (default info)
  -project value
        The log stream's project.
  -service-account-json string
        Path to JSON file with service account credentials to use.
  -timeout value
        If >0, a duration string for the maximum amount of time to wait for a log entry before exiting with a 2. A duration string is a sequence of <number><unit> such as 2h15m. Supported units are 'ns', 'us'/'µs', 'ms', 's', 'm', and 'h'.

Sign in to add a comment