Skip to content

Commit

Permalink
fix some mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
fzerorubigd committed Nov 6, 2014
1 parent a6cdd9f commit baa61ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
19 changes: 2 additions & 17 deletions tmass.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,14 @@ use --forcenew to overwrite this`,
},
}

// cobra has a bug with flags attache to root command, so add them twice here for dirty workaround
load.Flags().StringVar(
root.PersistentFlags().StringVar(
&tmuxCmd,
"tmux",
"tmux",
`The tmux command to use, just if tmux is not in the $PATH`,
)

load.Flags().StringVarP(
&layoutDir,
"layout-dir",
"l",
home+"/.config/tmass/",
`Layout directory, contain layout files`,
)
save.Flags().StringVar(
&tmuxCmd,
"tmux",
"tmux",
`The tmux command to use, just if tmux is not in the $PATH`,
)

save.Flags().StringVarP(
root.PersistentFlags().StringVarP(
&layoutDir,
"layout-dir",
"l",
Expand Down
7 changes: 4 additions & 3 deletions tools/zsh_tmass
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ case "$state" in
local commands; commands=(
'load:Load a tmux session from a file'
'save:Save current tmux session in a file'
'help:Show help'
)
_describe -t commands 'command' commands && ret=0
;;
(args)
local sec; sec=(
'--tmux:Tmux executable if its not in PATH or name is different from tmux'
'--layout-dir: layout directory to load/save from/to'
'--tmux=:Tmux executable if its not in PATH or name is different from tmux'
'--layout-dir=: layout directory to load/save from/to'
)

case "${line[1]}" in
Expand All @@ -31,7 +32,7 @@ case "$state" in
(load)
sec+=(
"--help: help on load"
"--forceneww: force a new session even if inside a tmux"
"--forcenew: force a new session even if inside a tmux"
"--rename: pick a new random name if the requested name is already used"
)
IFS=$'\n' sec+=($(ls ~/.config/tmass))
Expand Down

0 comments on commit baa61ae

Please sign in to comment.