Compare commits
3 Commits
v0.9
...
GHPS/ZSH-C
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fdcf8ae6d | ||
| c528af6414 | |||
|
|
9ea667f201 |
@@ -2,7 +2,7 @@ _sshch_complete()
|
|||||||
{
|
{
|
||||||
local cur_word alias_list
|
local cur_word alias_list
|
||||||
cur_word="${COMP_WORDS[COMP_CWORD]}"
|
cur_word="${COMP_WORDS[COMP_CWORD]}"
|
||||||
alias_list=`sshch -l | sed 's/,//g'`
|
alias_list=`sshch -l`
|
||||||
COMPREPLY=($(compgen -W "$alias_list" -- $cur_word))
|
COMPREPLY=($(compgen -W "$alias_list" -- $cur_word))
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
27
completion/sshch_zsh_completion.sh
Normal file
27
completion/sshch_zsh_completion.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#compdef sshch
|
||||||
|
#
|
||||||
|
# ZSH Completion for SSHCH
|
||||||
|
# Usage:
|
||||||
|
# 1) Place File in a Directory where ZSH can find it
|
||||||
|
# -> Search Path is Stored in $fpath
|
||||||
|
# -> echo $fpath
|
||||||
|
# 2) Rename File to '_sshch'
|
||||||
|
#
|
||||||
|
_arguments '::aliasname:->getAlias' \
|
||||||
|
'-e[Edit Alias]:aliasname:->getAlias' '--edit[Edit Alias]:aliasname:->getAlias' \
|
||||||
|
'-p[Set Password]:aliasname:->getAlias' '--password[Set Password]:aliasname:->getAlias' \
|
||||||
|
'-r[Remove Alias]:aliasname:->getAlias' '--remove[Remove Alias]:aliasname:->getAlias' \
|
||||||
|
'-k[Keep Connection]:aliasname:->getAlias' '--keep[Keep Connection]:aliasname:->getAlias' \
|
||||||
|
'-a[Add Alias]' '--add[Add Alias]'\
|
||||||
|
'-c[Add Command for Executing Alias]' '--command[Add Command for Executing Alias]'\
|
||||||
|
'-h[Show Help Message]' '--help[Show Help Message]'\
|
||||||
|
'-l[List Existing Alias]' '--list[List Existing Alias]'\
|
||||||
|
'-f[List Existing Alias with Connection String]' '--fulllist[List Existing Alias with Connection String]'\
|
||||||
|
'--version[Show Program Version]'
|
||||||
|
case "$state" in
|
||||||
|
getAlias)
|
||||||
|
local -a alias_list
|
||||||
|
alias_list=($(sshch -l))
|
||||||
|
_values -s ' ' 'Aliases' $alias_list
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -133,7 +133,7 @@ def CMDConnect(aliases, command=False):
|
|||||||
|
|
||||||
|
|
||||||
def CMDList(option, opt, value, parser):
|
def CMDList(option, opt, value, parser):
|
||||||
print(', '.join(str(p) for p in conf.sections()))
|
print(' '.join(str(p) for p in conf.sections()))
|
||||||
|
|
||||||
|
|
||||||
def CMDFullList(option, opt, value, parser):
|
def CMDFullList(option, opt, value, parser):
|
||||||
|
|||||||
Reference in New Issue
Block a user