-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #70 Add auto completion tab for fish, bash, zsh and powershell (#83) * Add auto completion tab for fish, bash, zsh and powershell * Update README to include instuctions for auto-complete * Add concurrent sessions to the CLI #88 (#89) * #96 allow more than 2 certificates in cert chain (#97) * Revert "#90 add no limit to default cybr conjur list command" (#102) * Add installation instruction for AWS CloudShell (#101) * #90 add no limit to default cybr conjur list command (#94) * Revert "#90 add no limit to default cybr conjur list command (#94)" This reverts commit 04d2f8c. Co-authored-by: Quincy Cheng <quincy.cheng@gmail.com> Co-authored-by: Andrew Copeland <50109276+AndrewCopeland@users.noreply.github.com> * V0.1.2 beta #47 account move (#93) * Change platform properties to map[string]string to me consistent with requests.AddAccount * #44 move an account to a new safe * Resolves #98 so windows login works correctly (#99) * Resolves #98 so windows login works correctly * Use strings.TrimSpace() instead of strings.Replace() * Add --password flag so CCP can retrieve REST API password #66 (#92) * Add --password flag to so CCP can retrieve REST API password #66 * Move check to beginning Co-authored-by: Andrew Copeland <50109276+AndrewCopeland@users.noreply.github.com> Co-authored-by: Quincy Cheng <quincy.cheng@gmail.com>
- Loading branch information
1 parent
04d2f8c
commit 83c6e4a
Showing
8 changed files
with
184 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var completionCmd = &cobra.Command{ | ||
Use: "completion [bash|zsh|fish|powershell]", | ||
Short: "Generate completion script", | ||
Long: `To load completions: | ||
Bash: | ||
$ source <(cybr completion bash) | ||
# To load completions for each session, execute once: | ||
# Linux: | ||
$ cybr completion bash > /etc/bash_completion.d/cybr | ||
# macOS: | ||
$ cybr completion bash > /usr/local/etc/bash_completion.d/cybr | ||
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: | ||
$ cybr completion zsh > "${fpath[1]}/_cybr" | ||
# You will need to start a new shell for this setup to take effect. | ||
fish: | ||
$ cybr completion fish | source | ||
# To load completions for each session, execute once: | ||
$ cybr completion fish > ~/.config/fish/completions/cybr.fish | ||
PowerShell: | ||
PS> cybr completion powershell | Out-String | Invoke-Expression | ||
# To load completions for every new session, run: | ||
PS> cybr completion powershell > cybr.ps1 | ||
# and source this file from your PowerShell profile. | ||
`, | ||
DisableFlagsInUseLine: true, | ||
ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, | ||
Args: cobra.ExactValidArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
switch args[0] { | ||
case "bash": | ||
cmd.Root().GenBashCompletion(os.Stdout) | ||
case "zsh": | ||
cmd.Root().GenZshCompletion(os.Stdout) | ||
case "fish": | ||
cmd.Root().GenFishCompletion(os.Stdout, true) | ||
case "powershell": | ||
cmd.Root().GenPowerShellCompletion(os.Stdout) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(completionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters