Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --force-basename option #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slafs
Copy link

@slafs slafs commented May 17, 2017

When extracting multiple similar archives with only one top-level
element, user usually wants to have them in a destination directory
named after archive's name.

Currently the first archive is extracted to a directory named after
the single top-level element while other archives are extracted
to directories named after archive's basename.

The --force-basename option is forcing the latter behaviour for every
archive.

For example, let's say we have two archives, with only one top-level
directory in them (called var):

$ ls BundleLogs*zip
BundleLogs-1495008842230.zip  BundleLogs-1495008843374.zip

When trying to unpack them at once:

$ unp --output /tmp/logs BundleLogs*zip

The default behaviour leaves us with:

$ ls /tmp/logs
BundleLogs-1495008843374  var

Using --force-basename option:

$ unp --force-basename --output /tmp/logs_basename BundleLogs*zip

We get the following result:

$ ls /tmp/logs_basename
BundleLogs-1495008842230  BundleLogs-1495008843374

When extracting multiple similar archives with only one top-level
element, user usually wants to have them in a destination directory
named after archive's name.

Currently the first archive is extracted to a directory named after
the single top-level element while other archives are extracted
to directories named after archive's basename.

The `--force-basename` option is forcing the latter behaviour for every
archive.

For example, let's say we have two archives, with only one top-level
directory in them (called `var`):
```
$ ls BundleLogs*zip
BundleLogs-1495008842230.zip  BundleLogs-1495008843374.zip
```

When trying to unpack them at once:
```
$ unp --output /tmp/logs BundleLogs*zip
```

The default behaviour leaves us with:
```
$ ls /tmp/logs
BundleLogs-1495008843374  var
```

Using `--force-basename` option:
```
$ unp --force-basename --output /tmp/logs_basename BundleLogs*zip
```

We get the following result:
```
$ ls /tmp/logs_basename
BundleLogs-1495008842230  BundleLogs-1495008843374
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant