Skip to content

Commit

Permalink
refactor: add short flag -t for --timeout.command
Browse files Browse the repository at this point in the history
- `gossh fetch` flags have been changed:
  Before: `-t, --tmp-dir string     directory of target hosts for storing temporary zip file (default "$HOME")`
  After: `-T, --tmp-dir string     directory for storing temporary zip file on target hosts, only useful if the -z flag is used (default "$HOME")`

- Add short flag `-t` for `--timeout.command`:
  Before: `--timeout.command int`
  After: `-t, --timeout.command int`
  • Loading branch information
windvalley committed Jan 5, 2024
1 parent 346f956 commit 4bf61f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions internal/cmd/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ func init() {
"local directory that files/dirs from target hosts will be copied to",
)

fetchCmd.Flags().StringVarP(&tmpDir, "tmp-dir", "t", "$HOME",
"directory of target hosts for storing temporary zip file",
)

fetchCmd.Flags().BoolVarP(
&enableZipFiles,
"zip",
"z",
false,
"enable zip files ('zip' must be installed on target hosts)",
)

fetchCmd.Flags().StringVarP(&tmpDir, "tmp-dir", "T", "$HOME",
`directory for storing temporary zip file on target hosts,
only useful if the -z flag is used`,
)
}
4 changes: 2 additions & 2 deletions internal/pkg/configflags/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func NewTimeout() *Timeout {

// AddFlagsTo ...
func (t *Timeout) AddFlagsTo(flags *pflag.FlagSet) {
flags.IntVarP(&t.Command, flagTimeoutCommand, "t", t.Command,
`timeout seconds for handling each target host`)
flags.IntVarP(&t.Task, flagTimeoutTask, "", t.Task,
"timeout seconds for the entire gossh task")
flags.IntVarP(&t.Conn, flagTimeoutConn, "", t.Conn,
"timeout seconds for connecting each target host")
flags.IntVarP(&t.Command, flagTimeoutCommand, "", t.Command,
`timeout seconds for handling each target host`)
}

// Complete ...
Expand Down

0 comments on commit 4bf61f1

Please sign in to comment.