Skip to content

Commit

Permalink
change help
Browse files Browse the repository at this point in the history
  • Loading branch information
uesugi committed Jun 13, 2018
1 parent 85b3860 commit 34beae7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lscp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type CommandOption struct {
Host []string `arg:"-H,help:Connect servername"`
File string `arg:"-f,help:config file path"`
Permission bool `arg:"-p,help:copy file permission"`
From string `arg:"positional,required,help:Copy from path"`
To string `arg:"positional,required,help:Copy to path"`
From string `arg:"positional,required,help:Copy from path (local:<path>|remote:<path>)"`
To string `arg:"positional,required,help:Copy to path (local:<path>|remote:<path>)"`
}

// Version Setting
Expand Down
50 changes: 45 additions & 5 deletions misc/completions/zsh/_lscp
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
}
14 changes: 7 additions & 7 deletions misc/completions/zsh/_lssh
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' \
}

0 comments on commit 34beae7

Please sign in to comment.