-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
uesugi
committed
Jun 13, 2018
1 parent
85b3860
commit 34beae7
Showing
3 changed files
with
54 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,48 @@ | ||
#compdef lscp | ||
_lssh() { | ||
|
||
_aftercolon() { | ||
if compset -P 1 '*:'; then | ||
_files "$expl[@]" | ||
else | ||
_files "$expl[@]" | ||
fi | ||
} | ||
|
||
_lscp() { | ||
_arguments -s \ | ||
{-h,--help}'[Show help]' \ | ||
{-p,--permission}'[Connect servernaem]' \ | ||
{-H,--host}'[Connect servernaem]' \ | ||
{-f,--file}'+[Config file path]:include file:_files' \ | ||
'(- *)'{-h,--help}'[Show help]' \ | ||
'(-p,--permission)'{-p,--permission}'[copy with permission flag]' \ | ||
'(-H --host)'{-H,--host}'[Connect servername]:_message' \ | ||
'(-f --file)'{-f,--file}'+[Config file path]:include file:_files' \ | ||
'*:: :->args' \ | ||
&& ret=0 | ||
case $state in | ||
(args) | ||
case $words[1] in | ||
(l:) | ||
_aftercolon && ret=0 | ||
;; | ||
(local:) | ||
_aftercolon && ret=0 | ||
;; | ||
(r:) | ||
# TODO | ||
;; | ||
(remote:) | ||
# TODO | ||
;; | ||
esac | ||
;; | ||
esac | ||
|
||
return ret | ||
} | ||
|
||
__lscp_type () { | ||
local -a _t | ||
_t=( | ||
{local,l}':local' | ||
{remote,r}':remote' | ||
) | ||
_describe -t values "Type" _t | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#compdef lssh | ||
_lssh() { | ||
_arguments -s \ | ||
{-h,--help}'[Show help]' \ | ||
{-H,--host}'[Connect servernaem]:_message' \ | ||
{-l,--list}'[Print server list]' \ | ||
{-t,--terminal}'[Run specified command at terminal]' \ | ||
{-p,--parallel}'[Exec command parallel node(tail -F etc...)]' \ | ||
{-c,--command}'[Remote Server exec command.]:_message' \ | ||
{-f,--file}'+[Config file path]:include file:_files' \ | ||
'(- *)'{-h,--help}'[Show help]' \ | ||
'(-H --host)'{-H,--host}'[Connect servername]:_message' \ | ||
'(- *)'{-l,--list}'[Print server list]' \ | ||
'(-t --terminal)'{-t,--terminal}'[Run specified command at terminal]' \ | ||
'(-p --parallel)'{-p,--parallel}'[Exec command parallel node(tail -F etc...)]' \ | ||
'(-c --command)'{-c,--command}'[Remote Server exec command.]:_message' \ | ||
'(-f --file)'{-f,--file}'+[Config file path]:include file:_files' \ | ||
} |