Skip to content

Commit

Permalink
add dirpath option
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 23, 2023
1 parent 761fa75 commit ee64aac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/punzip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ func main() {
}

var concurrency int
var dirPath string
flag.IntVar(&concurrency, "concurrency", runtime.GOMAXPROCS(0), "allow up to n compression routines")
flag.StringVar(&dirPath, "d", ".", "extract files into the specified directory")

flag.Parse()

Expand All @@ -33,7 +35,7 @@ func main() {
return
}

cli := pzip.ExtractorCLI{ArchivePath: args[0], DirPath: ".", Concurrency: concurrency}
cli := pzip.ExtractorCLI{ArchivePath: args[0], DirPath: dirPath, Concurrency: concurrency}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
go func() {
<-ctx.Done()
Expand Down

0 comments on commit ee64aac

Please sign in to comment.