forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gctcli: bump urfave cli depends version (thrasher-corp#698)
* gctcli: bump version * gctcli: flag alias done differenttttttttttttt * gctcli: add autocomplete scripts to folder within gctcli cmd folder structure
- Loading branch information
Showing
11 changed files
with
428 additions
and
368 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
contrib/bash_autocomplete → cmd/gctcli/autocomplete/bash_autocomplete
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,13 @@ | ||
# PowerShell programmable completion for gctcli | ||
# For info on implementation for current shell session or persistence: | ||
# https://github.com/urfave/cli/blob/master/docs/v2/manual.md#powershell-support | ||
|
||
$fn = $($MyInvocation.MyCommand.Name) | ||
$name = $fn -replace "(.*)\.ps1$", '$1' | ||
Register-ArgumentCompleter -Native -CommandName $name -ScriptBlock { | ||
param($commandName, $wordToComplete, $cursorPosition) | ||
$other = "$wordToComplete --generate-bash-completion" | ||
Invoke-Expression $other | ForEach-Object { | ||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) | ||
} | ||
} |
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,27 @@ | ||
#compdef $PROG | ||
|
||
# zsh programmable completion for gctcli | ||
# For info on implementation for current shell session or persistence: | ||
# https://github.com/urfave/cli/blob/master/docs/v2/manual.md#zsh-support | ||
|
||
_gctcli() { | ||
|
||
local -a opts | ||
local cur | ||
cur=${words[-1]} | ||
if [[ "$cur" == "-"* ]]; then | ||
opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}") | ||
else | ||
opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}") | ||
fi | ||
|
||
if [[ "${opts[1]}" != "" ]]; then | ||
_describe 'values' opts | ||
else | ||
_files | ||
fi | ||
|
||
return | ||
} | ||
|
||
compdef _gctcli $PROG |
Oops, something went wrong.