Skip to content

Hide completion command from help.#263

Merged
knative-prow-robot merged 1 commit into
knative:masterfrom
evankanderson:hidden-helper
Jul 12, 2019
Merged

Hide completion command from help.#263
knative-prow-robot merged 1 commit into
knative:masterfrom
evankanderson:hidden-helper

Conversation

@evankanderson
Copy link
Copy Markdown
Member

Proposed Changes

  • Hide the presence of the kn completion command so that users mostly see the active command surface.
`kn completion` is no longer suggested by `kn help`. The command still exists
to enable command-line completion, but it should not be advertised in normal
usage.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 12, 2019
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@evankanderson: 0 warnings.

Details

In response to this:

Proposed Changes

  • Hide the presence of the kn completion command so that users mostly see the active command surface.
`kn completion` is no longer suggested by `kn help`. The command still exists
to enable command-line completion, but it should not be advertised in normal
usage.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 12, 2019
@evankanderson
Copy link
Copy Markdown
Member Author

/assign @rhuss

@duglin
Copy link
Copy Markdown
Contributor

duglin commented Jul 12, 2019

oh the mental conflict! :-)
On the one hand, +1 since I'm not fan of that command/noun to being with!
On the other hand, I'm not a fan of hiding comands from the user either. How would anyone know about this command at all? Would our docs still talk about it?

If we keep it, I'm leaning more towards @rhuss's suggestion of having the help show groupings and putting this under misc instead of lying to the user about what commands are actually available.

@evankanderson
Copy link
Copy Markdown
Member Author

Sample output:

$ .\kn help
Manage your Knative building blocks:

* Serving: Manage your services and release new software to them.
* Eventing: Manage event subscriptions and channels. Connect up event sources.

Usage:
  kn [command]

Available Commands:
  help        Help about any command
  revision    Revision command group
  route       Route command group
  service     Service command group
  version     Prints the client version

Flags:
      --config string       config file (default is $HOME/.kn/config.yaml)
  -h, --help                help for kn
      --kubeconfig string   kubectl config file (default is $HOME/.kube/config)

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

$ kn help completion
Output shell completion code (default Bash)

Usage:
  kn completion [flags]

Flags:
  -h, --help   help for completion
      --zsh    Generates completion code for Zsh shell.

Global Flags:
      --config string       config file (default is $HOME/.kn/config.yaml)
      --kubeconfig string   kubectl config file (default is $HOME/.kube/config)

The use of kn completion is documented here:

https://github.com/knative/client#docs

Run the following command to enable BASH auto-completion:

$ source <(kn completion)

My $0.02 is that hiding kn completion in the help (but documenting it in the docs) is appropriate, as running the command on its own doesn't help, you need to do a special invocation (e.g. source <(kn completion)) for the command to work. As such, it makes more sense to document it a different way.

@maximilien
Copy link
Copy Markdown
Contributor

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2019
Copy link
Copy Markdown
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

👍

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evankanderson, maximilien

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [evankanderson,maximilien]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit be24f7b into knative:master Jul 12, 2019
@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jul 13, 2019

Hmm, not sure how this PR could pass the tests, as the documentation has not be regenerated, nor the autoformatting has been applied (e.g. has not been build with hack/build.sh.

I'm going to extend our tests that all generated files have been generated.

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jul 13, 2019

Added check & fix to #265

navidshaikh added a commit to navidshaikh/client that referenced this pull request Feb 10, 2020
to `openshift/origin-release:golang-1.13`
dsimansk pushed a commit to dsimansk/client that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants