diff --git a/.vscode/launch.json b/.vscode/launch.json index ef9ea37..aaea6bc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,8 +9,8 @@ "program": "${workspaceFolder}/main.go", "args": [ "--verbose", - "--PASSWORD", - "$velvet90", + "--password", + "$Velvet90", "--concurrency", "12", "--delay", diff --git a/settings/arguments.go b/settings/arguments.go index fb169a4..1fc96d7 100644 --- a/settings/arguments.go +++ b/settings/arguments.go @@ -16,14 +16,14 @@ func Initialize() { for index := 1; index < len(os.Args); index++ { arg := strings.ToLower(os.Args[index]) if arg != "-v" && arg != "--verbose" { - arguments = append(arguments, arg) + arguments = append(arguments, os.Args[index]) continue } setVerbose(true) } var filteredArguments []string for index := 0; index < len(arguments); index++ { - switch arguments[index] { + switch strings.ToLower(arguments[index]) { case "-h": fallthrough case "--help": diff --git a/tools/rsync.go b/tools/rsync.go index c94660c..425cd7d 100644 --- a/tools/rsync.go +++ b/tools/rsync.go @@ -175,9 +175,10 @@ func getTargetLocation(sourceFile string) string { } source, _ := strings.CutSuffix(settings.Source, "/*") if settings.SourceIsRemote() { - _, source, _ = strings.Cut(settings.Source, ":") + _, source, _ = strings.Cut(source, ":") + source = filepath.Dir(source) } - return filepath.Join(settings.Target, strings.Replace(sourceFile, filepath.Dir(source), "", 1)) + return filepath.Join(settings.Target, strings.Replace(sourceFile, source, "", 1)) } func createProgressBar(barcontainer *mpb.Progress, name string, size int64, max int64, priority int, total bool) *mpb.Bar {