Skip to content

Commit

Permalink
refactor: rename dirpath to outputdir
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 24, 2023
1 parent 7cf8b78 commit 7417ee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ func (a *ArchiverCLI) Archive(ctx context.Context) error {

type ExtractorCLI struct {
ArchivePath string
DirPath string
OutputDir string
Concurrency int
}

func (e *ExtractorCLI) Extract(ctx context.Context) error {
extractor, err := NewExtractor(e.DirPath, ExtractorConcurrency(e.Concurrency))
extractor, err := NewExtractor(e.OutputDir, ExtractorConcurrency(e.Concurrency))
if err != nil {
return errors.Wrap(err, "ERROR: could not create extractor")
}
defer extractor.Close()

if err = extractor.Extract(ctx, e.ArchivePath); err != nil {
return errors.Wrapf(err, "ERROR: could not extract %s to %s", e.ArchivePath, e.DirPath)
return errors.Wrapf(err, "ERROR: could not extract %s to %s", e.ArchivePath, e.OutputDir)

}

Expand Down
6 changes: 3 additions & 3 deletions cmd/punzip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func main() {
}

var concurrency int
var dirPath string
var outputDir 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.StringVar(&outputDir, "d", ".", "extract files into the specified directory")

flag.Parse()

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

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

0 comments on commit 7417ee0

Please sign in to comment.