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",
"args": [
"--verbose",
"--PASSWORD",
"$velvet90",
"--password",
"$Velvet90",
"--concurrency",
"12",
"--delay",

View file

@ -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":

View file

@ -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 {