File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 5
5
"os"
6
6
"os/exec"
7
7
"syscall"
8
+ "strings"
8
9
9
10
"github.com/null93/aws-knox/pkg/color"
10
11
"github.com/null93/aws-knox/sdk/credentials"
@@ -14,15 +15,11 @@ import (
14
15
)
15
16
16
17
var connectCmd = & cobra.Command {
17
- Use : "connect < instance-search-term> " ,
18
+ Use : "connect [ instance-search-term] " ,
18
19
Short : "Connect to an EC2 instance using session-manager-plugin" ,
19
- Args : cobra .MaximumNArgs (1 ),
20
20
Run : func (cmd * cobra.Command , args []string ) {
21
- searchTerm := ""
21
+ searchTerm := strings . Join ( args , " " )
22
22
currentSelector := "instance"
23
- if len (args ) > 0 {
24
- searchTerm = args [0 ]
25
- }
26
23
var err error
27
24
var role * credentials.Role
28
25
var action string
Original file line number Diff line number Diff line change @@ -164,15 +164,11 @@ func rsyncPortForward(role *credentials.Role, instanceId string) {
164
164
}
165
165
166
166
var syncCmd = & cobra.Command {
167
- Use : "sync < instance-search-term> " ,
167
+ Use : "sync [ instance-search-term] " ,
168
168
Short : "start rsyncd and port forward to it" ,
169
- Args : cobra .MaximumNArgs (1 ),
170
169
Run : func (cmd * cobra.Command , args []string ) {
171
- searchTerm := ""
170
+ searchTerm := strings . Join ( args , " " )
172
171
currentSelector := "instance"
173
- if len (args ) > 0 {
174
- searchTerm = args [0 ]
175
- }
176
172
var err error
177
173
var role * credentials.Role
178
174
var action string
You can’t perform that action at this time.
0 commit comments