File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,17 @@ func newCopyCommand() *cobra.Command {
31
31
RunE : copyAction ,
32
32
}
33
33
34
+ copyCommand .Flags ().BoolP ("recursive" , "r" , false , "copy directories recursively" )
35
+
34
36
return copyCommand
35
37
}
36
38
37
39
func copyAction (cmd * cobra.Command , args []string ) error {
40
+ recursive , err := cmd .Flags ().GetBool ("recursive" )
41
+ if err != nil {
42
+ return err
43
+ }
44
+
38
45
arg0 , err := exec .LookPath ("scp" )
39
46
if err != nil {
40
47
return err
@@ -43,7 +50,6 @@ func copyAction(cmd *cobra.Command, args []string) error {
43
50
if err != nil {
44
51
return err
45
52
}
46
-
47
53
instDirs := make (map [string ]string )
48
54
scpArgs := []string {}
49
55
debug , err := cmd .Flags ().GetBool ("debug" )
@@ -53,6 +59,9 @@ func copyAction(cmd *cobra.Command, args []string) error {
53
59
if debug {
54
60
scpArgs = append (scpArgs , "-v" )
55
61
}
62
+ if recursive {
63
+ scpArgs = append (scpArgs , "-r" )
64
+ }
56
65
scpArgs = append (scpArgs , "-3" , "--" )
57
66
for _ , arg := range args {
58
67
path := strings .Split (arg , ":" )
You can’t perform that action at this time.
0 commit comments