Comments (3)
The output of "ouch --help" gives "Usage: ouch [OPTIONS] " the options before the command. Is it necessary to respect the order?
No, --gitignore
is currently a global flag because it applies to all 3 subcommands.
Thanks for your input, having a --exclude
flag sounds like a great path to solve this one.
from ouch.
This can be a bit confusing, here's how -g/--gitignore
works:
When recursing through directory entries, do not include the ones in .gitignore
.
(This can be useful if you want to compress a repository without including the build artifacts.)
However, you can bypass -g/--gitignore
by providing the explicit name of the files you want.
That's what you're doing, your shell (bash, zsh or fish) expands *
to the two arguments "PNG.zip"
and "SVG.zip"
, so you're bypassing the -g
flag.
The current workaround would be to pass the folder itself to Ouch.
cd ..
ouch compress folder testo.tar.gz --gitignore
But we can also discuss wether we want to remove the capability to bypass --gitignore
.
-g, --gitignore
Ignores files matched by git's ignore files
Also, we need to update the --help
to make this clear, and maybe document it in README.md.
from ouch.
@marcospb19 Thanks for your response
However, you can bypass -g/--gitignore by providing the explicit name of the files you want.
The files contained in folders are too numerous to be defined by hand. That's why I took PNG.zip
and SVG.zip
to create this issue. π₯.
The current workaround would be to pass the folder itself to Ouch.
It wasn't the folder I wanted to compress, but the contents only, and above all to be able to access the files directly when opening the archive (to avoid --strip-components=1 with tar for example).
That's what you're doing, your shell (bash, zsh or fish) expands * to the two arguments "PNG.zip" and "SVG.zip", so you're bypassing the -g flag.
The idea is to take everything (*) in the folder but exclude the files mentioned in .gitignore and/or .gitignore file itself. To use git with .gitignore file, you have to be in the folder itself at the root of the .git folder and the git command takes .gitignore into account in the same place, no need to pass the parent folder.
Ouch could perhaps be inspired by the "tar" command with --exclude arg. Passing several exclusion arguments in the same way (--exclude "<regex/*.ext/string...etc>") otherwise the .gitignore or .ouchignore file idea is also good to avoid multiple --exclude arguments.
tar -czvf testo.tar.gz --exclude "*.zip" --exclude "*.tar.gz" -C <path> .(dot) --overwrite
tar -czvf testo.tar.gz --exclude "*.zip" --exclude "*.tar.gz" .(dot) --overwrite
The output of "ouch --help" gives "Usage: ouch [OPTIONS] <COMMAND>" the options before the command. Is it necessary to respect the order?
from ouch.
Related Issues (20)
- Duplicating file suffix causes panic: "entered unreachable code" HOT 2
- Remove `Bzip1` as an alias to `Bzip2`
- When decompressing with `--format`, don't overwrite input
- 'smart unpack' sometimes chooses an illogical name for the directory HOT 2
- Overwrite behavior removes files differently than expected
- If the compressed file name contains a dot, ouch use it as a folder name until then. HOT 3
- Panic with large archive file HOT 6
- Progress size unit is inconsistent HOT 1
- Ignore __MACOSX by default HOT 3
- Be compatible with tee utility HOT 3
- Parallel decompression emits unaligned progress
- bgzf support
- About 0.4.2 release HOT 2
- Cargo version stuck on 0.4.1 even though 0.4.2 is released HOT 1
- `--format` flag order matters HOT 1
- Flag `-g/--gitignore` doesn't ignore the default `.git*` files HOT 4
- Ouch explodes when parallel decompression requires `stdin` interaction HOT 6
- Error message for `--format .tar.gz` outputs empty extension HOT 1
- Make support for format a feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ouch.