From 061393d41c8eab683b16965b1dbc85edb1f5365b Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 4 Oct 2021 14:09:06 -0400 Subject: [PATCH] Generate docs for new CLI surfaces (#843) Signed-off-by: Jason Hall --- doc/cosign.md | 1 + doc/cosign_attest.md | 1 + doc/cosign_completion.md | 53 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 doc/cosign_completion.md diff --git a/doc/cosign.md b/doc/cosign.md index 99594cc4596..5d58fdf3804 100644 --- a/doc/cosign.md +++ b/doc/cosign.md @@ -16,6 +16,7 @@ * [cosign attest](cosign_attest.md) - Attest the supplied container image. * [cosign clean](cosign_clean.md) - Remove all signatures from an image. cosign clean +* [cosign completion](cosign_completion.md) - Generate completion script * [cosign copy](cosign_copy.md) - Copy the supplied container image and signatures. * [cosign dockerfile](cosign_dockerfile.md) - Provides utilities for discovering images in and performing operations on Dockerfiles * [cosign download](cosign_download.md) - Provides utilities for downloading artifacts and attached artifacts in a registry diff --git a/doc/cosign_attest.md b/doc/cosign_attest.md index eb10102f57e..aba94a80bc1 100644 --- a/doc/cosign_attest.md +++ b/doc/cosign_attest.md @@ -45,6 +45,7 @@ cosign attest [flags] --key string path to the private key file, KMS URI or Kubernetes Secret --predicate string path to the predicate file. -r, --recursive if a multi-arch image is specified, additionally sign each discrete image + --rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev") --sk whether to use a hardware security key --slot string security key slot to use for generated key (default: signature) (authentication|signature|card-authentication|key-management) --type string specify predicate type (default: custom) (slsaprovenance|link|spdx) (default "custom") diff --git a/doc/cosign_completion.md b/doc/cosign_completion.md new file mode 100644 index 00000000000..d952f60027b --- /dev/null +++ b/doc/cosign_completion.md @@ -0,0 +1,53 @@ +## cosign completion + +Generate completion script + +### Synopsis + +To load completions: +Bash: + $ source <(cosign completion bash) + # To load completions for each session, execute once: + # Linux: + $ cosign completion bash > /etc/bash_completion.d/cosign + # macOS: + $ cosign completion bash > /usr/local/etc/bash_completion.d/cosign +Zsh: + # If shell completion is not already enabled in your environment, + # you will need to enable it. You can execute the following once: + $ echo "autoload -U compinit; compinit" >> ~/.zshrc + # To load completions for each session, execute once: + $ cosign completion zsh > "${fpath[1]}/_cosign" + # You will need to start a new shell for this setup to take effect. +fish: + $ cosign completion fish | source + # To load completions for each session, execute once: + $ cosign completion fish > ~/.config/fish/completions/cosign.fish +PowerShell: + PS> cosign completion powershell | Out-String | Invoke-Expression + # To load completions for every new session, run: + PS> cosign completion powershell > cosign.ps1 + # and source this file from your PowerShell profile. + + +``` +cosign completion [bash|zsh|fish|powershell] +``` + +### Options + +``` + -h, --help help for completion +``` + +### Options inherited from parent commands + +``` + --output-file string log output to a file + -d, --verbose log debug output +``` + +### SEE ALSO + +* [cosign](cosign.md) - +