some minor bugfixes

This commit is contained in:
Daniel Sommer 2023-09-22 16:42:59 +02:00
parent e9f89da36f
commit 9c8fe4ba1e
3 changed files with 7 additions and 6 deletions

4
.vscode/launch.json vendored
View file

@ -9,8 +9,8 @@
"program": "${workspaceFolder}/main.go", "program": "${workspaceFolder}/main.go",
"args": [ "args": [
"--verbose", "--verbose",
"--PASSWORD", "--password",
"$velvet90", "$Velvet90",
"--concurrency", "--concurrency",
"12", "12",
"--delay", "--delay",

View file

@ -16,14 +16,14 @@ func Initialize() {
for index := 1; index < len(os.Args); index++ { for index := 1; index < len(os.Args); index++ {
arg := strings.ToLower(os.Args[index]) arg := strings.ToLower(os.Args[index])
if arg != "-v" && arg != "--verbose" { if arg != "-v" && arg != "--verbose" {
arguments = append(arguments, arg) arguments = append(arguments, os.Args[index])
continue continue
} }
setVerbose(true) setVerbose(true)
} }
var filteredArguments []string var filteredArguments []string
for index := 0; index < len(arguments); index++ { for index := 0; index < len(arguments); index++ {
switch arguments[index] { switch strings.ToLower(arguments[index]) {
case "-h": case "-h":
fallthrough fallthrough
case "--help": case "--help":

View file

@ -175,9 +175,10 @@ func getTargetLocation(sourceFile string) string {
} }
source, _ := strings.CutSuffix(settings.Source, "/*") source, _ := strings.CutSuffix(settings.Source, "/*")
if settings.SourceIsRemote() { 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 { func createProgressBar(barcontainer *mpb.Progress, name string, size int64, max int64, priority int, total bool) *mpb.Bar {