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

RSDK-9288: declutter UI #4692

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

purplenicole730
Copy link
Member

@purplenicole730 purplenicole730 commented Jan 8, 2025

Changes:

  • hide help command for all commands with a subcommand list
  • fix incorrect usage text and remove arguments from usage text
  • standardize usage text to better reflect what's required and optional
  • remove arguments and replace with flags, keep backwards capability

Most of the changes can be shown through the following examples.
Before: command is unclear if it's supposed to be replaced or not, and arguments is misleading

rdk % go run ./cli/viam --help                 
USAGE:
   viam [global options] command [command options] [arguments...]

After: remove arguments and highlight command is something to replace:

rdk % go run ./cli/viam --help
USAGE:
   viam [global options] <command> [command options]

Before: ignores login options and ignores that command is optional

rdk % go run ./cli/viam login --help
USAGE:
   viam login command [command options] [arguments...]

After: alludes to login options and command is now optional

rdk % go run ./cli/viam login --help
USAGE:
   viam login [options] [command] [command options]

Before: Incorrectly shows additional options and arguments when there are none

rdk % go run ./cli/viam login print-access-token --help
USAGE:
   viam login print-access-token [command options] [arguments...]

After: Show clear and correct usage

rdk % go run ./cli/viam login print-access-token --help
USAGE:
   viam login print-access-token

Before: incorrect command name and alludes to nonexistent other options

rdk % go run ./cli/viam organizations auth-service enable --help
USAGE:
   viam enable --org-id=<org-id> [other options]

After: correct way to use command

rdk % go run ./cli/viam organizations auth-service enable --help
USAGE:
   viam organizations auth-service enable --org-id=<org-id>

Before: shows wrong usage of org-id flag and ignores subcommands

rdk % go run ./cli/viam organizations logo --help
USAGE:
   viam organizations logo --org-id=<org-id> [other options]

COMMANDS:
   set      set the logo for an organization from a local file
   get      get the logo for an organization
   help, h  Shows a list of commands or help for one command

After: correct usage of logo without flags and with subcommands. hides help subcommand

rdk % go run ./cli/viam organizations logo --help               
USAGE:
   viam organizations logo <command> [command options]

COMMANDS:
   set  set the logo for an organization from a local file
   get  get the logo for an organization

Before: Alludes to command options that don't exist, inconsistent org argument

rdk % go run ./cli/viam locations list --help
USAGE:
   viam locations list [command options] [organization]

OPTIONS:
   --help, -h  show help (default: false)

After: add org flag, remove arguments suggestion

rdk % go run ./cli/viam locations list --help
USAGE:
   viam locations list [options]

OPTIONS:
   --organization value, --org value, --org-id value, --org-name value  (default: first organization alphabetically)

Test to make sure:

  • default continues working
  • flag works
  • argument works for backwards capability
  • flag takes priority over argument
rdk % go run ./cli/viam locations list                     
Locations for "<>":
<>:
        First Location (id: <>)
rdk % go run ./cli/viam locations list --organization "<>"
        First Location (id: <>)
rdk % go run ./cli/viam locations list "<>"               
        First Location (id: <>)
rdk % go run ./cli/viam locations list --organization "<>" "fake"
        First Location (id: <>)

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants