Skip to content

Commit 6764e5c

Browse files
committed
'scw exec SERVER [COMMAND]', COMMAND is now optional
1 parent 2eca092 commit 6764e5c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Interact with Scaleway API from the command line.
2525
* [`cp [OPTIONS] SERVER:PATH|HOSTPATH|- SERVER:PATH|HOSTPATH|-`](#scw-cp)
2626
* [`create [OPTIONS] IMAGE`](#scw-create)
2727
* [`events [OPTIONS]`](#scw-events)
28-
* [`exec [OPTIONS] SERVER COMMAND [ARGS...]`](#scw-exec)
28+
* [`exec [OPTIONS] SERVER [COMMAND] [ARGS...]`](#scw-exec)
2929
* [`history [OPTIONS] IMAGE`](#scw-history)
3030
* [`images [OPTIONS]`](#scw-images)
3131
* [`info [OPTIONS]`](#scw-info)
@@ -291,7 +291,7 @@ Options:
291291
#### `scw exec`
292292

293293
```console
294-
Usage: scw exec [OPTIONS] SERVER COMMAND [ARGS...]
294+
Usage: scw exec [OPTIONS] SERVER [COMMAND] [ARGS...]
295295

296296
Run a command on a running server.
297297

@@ -303,6 +303,7 @@ Options:
303303

304304
Examples:
305305

306+
$ scw exec myserver
306307
$ scw exec myserver bash
307308
$ scw exec myserver 'tmux a -t joe || tmux new -s joe || bash'
308309
$ exec_secure=1 scw exec myserver bash
@@ -1019,6 +1020,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
10191020

10201021
#### Features
10211022

1023+
* `scw exec SERVER [COMMAND] [ARGS...]`, *COMMAND* is now optional
10221024
* Showing the server MOTD when calling `scw run <image> [COMMAND]` without *COMMAND*
10231025
* Support of `scw attach --no-stdin` option
10241026
* Hiding sensitive data by default on `scw inspect` ([#64](https://github.com/scaleway/scaleway-cli/issues/64))

commands/exec.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import (
1717

1818
var cmdExec = &types.Command{
1919
Exec: runExec,
20-
UsageLine: "exec [OPTIONS] SERVER COMMAND [ARGS...]",
20+
UsageLine: "exec [OPTIONS] SERVER [COMMAND] [ARGS...]",
2121
Description: "Run a command on a running server",
2222
Help: "Run a command on a running server.",
2323
Examples: `
24+
$ scw exec myserver
2425
$ scw exec myserver bash
2526
$ scw exec myserver 'tmux a -t joe || tmux new -s joe || bash'
2627
$ exec_secure=1 scw exec myserver bash
@@ -47,7 +48,7 @@ func runExec(cmd *types.Command, args []string) {
4748
if execHelp {
4849
cmd.PrintUsage()
4950
}
50-
if len(args) < 2 {
51+
if len(args) < 1 {
5152
cmd.PrintShortUsage()
5253
}
5354

0 commit comments

Comments
 (0)