Skip to content

Commit 8298b44

Browse files
committed
[rget] bug fix for option flags
1 parent b9a62a0 commit 8298b44

File tree

1 file changed

+8
-3
lines changed
  • kadai3/imura81gt/rget/cmd/rget

1 file changed

+8
-3
lines changed

kadai3/imura81gt/rget/cmd/rget/main.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import (
99
)
1010

1111
func main() {
12+
concurrency := flag.Int("c", 1, "concurrency")
13+
outputDir := flag.String("o", "./", "output directory")
14+
15+
flag.Parse()
1216
option := rget.Option{
13-
Concurrency: *flag.Int("c", 10, "concurrency"),
17+
Concurrency: *concurrency,
18+
OutputDir: *outputDir,
1419
}
15-
flag.Parse()
1620
urls := flag.Args()
1721
if len(urls) != 1 {
1822
fmt.Fprintf(os.Stderr, "%s <url>\n", os.Args[0])
@@ -21,6 +25,7 @@ func main() {
2125
os.Exit(1)
2226
}
2327

24-
option.Url = urls[0]
28+
option.URL = urls[0]
29+
fmt.Println(option)
2530
rget.Run(option)
2631
}

0 commit comments

Comments
 (0)