Skip to content

Commit 840e377

Browse files
committed
Add a flag to use rsync instead of scp
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 219fe29 commit 840e377

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: cmd/limactl/guest_install.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func newGuestInstallCommand() *cobra.Command {
2424
ValidArgsFunction: cobra.NoFileCompletions,
2525
Hidden: true,
2626
}
27+
guestInstallCommand.Flags().BoolP("rsync", "", false, "use rsync")
2728
return guestInstallCommand
2829
}
2930

@@ -35,7 +36,12 @@ func runCmd(name string, flags []string, args ...string) error {
3536
return cmd.Run()
3637
}
3738

38-
func guestInstallAction(_ *cobra.Command, args []string) error {
39+
func guestInstallAction(cmd *cobra.Command, args []string) error {
40+
rsync, err := cmd.Flags().GetBool("rsync")
41+
if err != nil {
42+
return err
43+
}
44+
3945
instName := DefaultInstanceName
4046
if len(args) > 0 {
4147
instName = args[0]
@@ -55,6 +61,10 @@ func guestInstallAction(_ *cobra.Command, args []string) error {
5561

5662
scpExe := "scp"
5763
scpFlags := sshFlags
64+
if rsync {
65+
scpExe = "rsync"
66+
scpFlags = []string{"-e", "ssh -F " + sshConfig, "--progress"}
67+
}
5868

5969
y, err := inst.LoadYAML()
6070
if err != nil {

0 commit comments

Comments
 (0)