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

Update Cobra and Organize Help Command Output #1387

Merged
merged 4 commits into from
Jul 5, 2023
Merged

Conversation

danaelhe
Copy link
Member

@danaelhe danaelhe commented Jul 3, 2023

Updating Cobra and taking advantage of their grouping commands support.
From this:

doctl is a command line interface (CLI) for the DigitalOcean API.

Usage:
  doctl [command]

Available Commands:
  1-click         Display commands that pertain to 1-click applications
  account         Display commands that retrieve account details
  apps            Display commands for working with apps
  auth            Display commands for authenticating doctl with an account
  balance         Display commands for retrieving your account balance
  billing-history Display commands for retrieving your billing history
  completion      Generate the autocompletion script for the specified shell
  compute         Display commands that manage infrastructure
  databases       Display commands that manage databases
  help            Help about any command
  invoice         Display commands for retrieving invoices for your account
  kubernetes      Displays commands to manage Kubernetes clusters and configurations
  monitoring      [Beta] Display commands to manage monitoring
  projects        Manage projects and assign resources to them
  registry        Display commands for working with container registries
  serverless      Develop, test, and deploy serverless functions
  version         Show the current version
  vpcs            Display commands that manage VPCs

Flags:
  -t, --access-token string   API V2 access token
  -u, --api-url string        Override default API endpoint
  -c, --config string         Specify a custom config file (default "/Users/danaelhertani/Library/Application Support/doctl/config.yaml")
      --context string        Specify a custom authentication context name
  -h, --help                  help for doctl
      --interactive           Enable interactive behavior. Defaults to true if the terminal supports it (default true)
  -o, --output string         Desired output format [text|json] (default "text")
      --trace                 Show a log of network activity while performing a command
  -v, --verbose               Enable verbose output

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

To this:

% go run cmd/doctl/main.go          
doctl is a command line interface (CLI) for the DigitalOcean API.

Usage:
  doctl [command]

Manage DigitalOcean Resources:
  1-click         Display commands that pertain to 1-click applications
  account         Display commands that retrieve account details
  apps            Display commands for working with apps
  compute         Display commands that manage infrastructure
  databases       Display commands that manage databases
  kubernetes      Displays commands to manage Kubernetes clusters and configurations
  monitoring      [Beta] Display commands to manage monitoring
  projects        Manage projects and assign resources to them
  registry        Display commands for working with container registries
  serverless      Develop, test, and deploy serverless functions
  vpcs            Display commands that manage VPCs

Configure doctl:
  auth            Display commands for authenticating doctl with an account
  version         Show the current version

View Billing:
  balance         Display commands for retrieving your account balance
  billing-history Display commands for retrieving your billing history
  invoice         Display commands for retrieving invoices for your account

Additional Commands:
  completion      Generate the autocompletion script for the specified shell
  help            Help about any command

Flags:
  -t, --access-token string   API V2 access token
  -u, --api-url string        Override default API endpoint
  -c, --config string         Specify a custom config file (default "/Users/danaelhertani/Library/Application Support/doctl/config.yaml")
      --context string        Specify a custom authentication context name
  -h, --help                  help for doctl
      --interactive           Enable interactive behavior. Defaults to true if the terminal supports it (default true)
  -o, --output string         Desired output format [text|json] (default "text")
      --trace                 Show a log of network activity while performing a command
  -v, --verbose               Enable verbose output

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

@danaelhe danaelhe requested a review from a team July 3, 2023 18:43
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited to finally land this!

commands/doit.go Outdated Show resolved Hide resolved
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@danaelhe danaelhe merged commit ecc616a into main Jul 5, 2023
6 checks passed
@danaelhe danaelhe deleted the organize_help_output branch July 5, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants