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

WIP: remove usage template, use FlagErrorFunc? #1

Closed
wants to merge 1 commit into from

Conversation

sallyom
Copy link

@sallyom sallyom commented Aug 30, 2019

@soltysh WIP, wondering if this is what we're going for? No usage printed when bad flag is passed, only with --help.

example:

$ oc login --foo
Error: unknown flag: --foo
See 'oc login --help' for more information about a given command.

$ oc login --help
Examples:
  # Log in interactively
  oc login
  
  # Log in to the given server with the given certificate authority file
  oc login localhost:8443 --certificate-authority=/path/to/cert.crt
  
  # Log in to the given server with the given credentials (will not prompt interactively)
  oc login localhost:8443 --username=myuser --password=mypass

Options:
  -p, --password='': Password, will prompt if not provided
  -u, --username='': Username, will prompt if not provided

Usage:
  oc login [URL] [flags]

Use "oc options" for a list of global command-line options (applies to all commands).
$ oc --foo
Error: unknown flag: --foo
See 'oc <command> --help' for more information about a given command.

$ oc --help


Basic Commands:
  login           Log in to a server
 ---
Build and Deploy Commands:
  rollout         Manage a Kubernetes deployment or OpenShift deployment config
---

Application Management Commands:
  create          Create a resource from a file or from stdin.
---
Troubleshooting and Debugging Commands:
  logs            Print the logs for a resource
  rsh             Start a shell session in a pod
 ---
Advanced Commands:
  adm             Tools for managing a cluster
  replace         Replace a resource by filename or stdin
---
Settings Commands:
  logout          End the current server session
 ---
Other Commands:
  ex              Experimental commands under active development
---
Usage:
  oc [flags]

Use "oc <command> --help" for more information about a given command.
Use "oc options" for a list of global command-line options (applies to all commands).

@sallyom
Copy link
Author

sallyom commented Aug 30, 2019

will submit similar PR upstream : ), closing

@sallyom sallyom closed this Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant