diff options
| author | Paul Bütow <pbuetow@mimecast.com> | 2020-02-22 12:06:09 +0000 |
|---|---|---|
| committer | Paul Bütow <pbuetow@mimecast.com> | 2020-02-22 12:06:09 +0000 |
| commit | 6e176034306026b922c1df4231a1807f36cbe460 (patch) | |
| tree | 96405450466b12240302d306938c7af9b19f21ba /cmd | |
| parent | 4d2ab8e6dd645d345fa26d8a067ad6dc14fc1fce (diff) | |
can start commands in background and also cancel those via drun command
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/drun/main.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/drun/main.go b/cmd/drun/main.go index e11900e..1f0e0fe 100644 --- a/cmd/drun/main.go +++ b/cmd/drun/main.go @@ -23,6 +23,8 @@ func main() { var discovery string var displayVersion bool var noColor bool + var background bool + var cancel bool var serversStr string var silentEnable bool var sshPort int @@ -36,6 +38,8 @@ func main() { flag.BoolVar(&noColor, "noColor", false, "Disable ANSII terminal colors") flag.BoolVar(&silentEnable, "silent", false, "Reduce output") flag.BoolVar(&trustAllHosts, "trustAllHosts", false, "Auto trust all unknown host keys") + flag.BoolVar(&background, "background", false, "Command starts in background on the server") + flag.BoolVar(&cancel, "cancel", false, "Command will be cancelled if it runs in background") flag.IntVar(&connectionsPerCPU, "cpc", 10, "How many connections established per CPU core concurrently") flag.IntVar(&sshPort, "port", 2222, "SSH server port") flag.IntVar(&timeout, "timeout", 0, "Command execution timeout") @@ -69,7 +73,7 @@ func main() { Timeout: timeout, } - client, err := clients.NewRunClient(args) + client, err := clients.NewRunClient(args, background, cancel) if err != nil { panic(err) } |
