Comments (6)
makes sense. I would love to be as close (not a must) as possible to the linux zip command.
that means for example supporting
- multiple paths
zip target source1 source2 ....
- providing compression level in cli (optional) with -number param + alternate more readable flag (like --level 3) + default if not provided
- recursive flag? or should we have this by default? since... why not?
- what about glob support?
- for unzip, if target is not provided, its current dir (but i don't think we need the -d, lets use your solution of just second arg)
- file path/basedir - i think the base dir by default is based on input, so if someone put
zip target ./dir1/dir2/dir3
the output would have dir1/dir2/dir3. and to change that, user can define base dir (--base <whatever>
) and that will take for all source paths provided (otherwise its just really long and messy)
So to support difference base paths to different source paths, lets also support amend? (original-u
flag and lets add more readable--append
flag as alternate)
wdyt?
from duckscript.
- Multiple paths: yes, why not
- Compression level: from what I can see, the zip crate I mentioned does not support compression levels. Just two algorithms: bzip2 and deflate.
- Recursive: I think it should be recursive by default. Honesly I don't what use case for a non-recursive invocation would be. If there is actually a use case for that, we can make it opt-out.
- Globbing: On one hand, there is
GlobArray
. On the other, some commands (CPGlob
,SetModeGlob
) have globbing. I'd go forzip
without globbing (if there are no limitations on the number/length of arguments) but that is not very consistent with the commands I mentioned. - Unzip target: Ok
- Basedir: Ok
- Amend/append: Ok
Although I'm not sure whether the logic for CLI-like argument parsing is implemented for Duckscript commands (I mean, the arguments can be reordered so that requires a bit of handling).
Also, given that Duckscript has maps, these could help with that file path thing (for example, we could accept a map from the real paths to the paths in the archive). It deviates from the Linux command though.
from duckscript.
- compression - ok, so lets expose those as options (--type default/bzip2)
- recursive - ya exactly. thats why i'm for recursive by default and i was wondering if i'm missing out something
- glob - lets start without glob (starting small) and later we will rethink this
- parsing cli args - look at this example - https://github.com/sagiegurari/duckscript/blob/master/duckscript_sdk/src/sdk/std/net/http_client/mod.rs#L40
- maps - cool idea. i'm not a fanatic to follow linux guidelines. i try when i can to make it easier for people to use these commands, but its not a must at all. i think map is a nice idea and can be added as well (--path-map ${handle} i guess)
from duckscript.
@Red-Teapot would you like to PR this one or prefer me to do it?
from duckscript.
I think I can make the PR. However, that might take a while since I don't have much free time.
from duckscript.
thanks. no rush.
from duckscript.
Related Issues (20)
- Feature Request - echo Colored Text HOT 6
- Command to get file size HOT 1
- --recursive flag for some `fs` commands HOT 8
- Using multiple backslashes results in only a single one HOT 4
- Embed Examples HOT 2
- Run commands in exec/Get stdout from eval/Add some form of command substitution HOT 5
- Passing stdin with exec HOT 4
- Upgrade regex package versions to >=1.5.5 (security vulnerabilities) HOT 1
- Newline Escapes HOT 3
- AUR package for duckscript HOT 2
- glob follows symlinks recursively HOT 3
- mv file.rs new_file.rs does not work HOT 5
- Confusion about condition statement HOT 6
- public new release after security fix from ftp crate
- Support array spread in exec HOT 7
- How to change a directory's name HOT 4
- `replace` can not accept a unicode character like \u{FEFF} HOT 1
- `if eq` does not support empty strings HOT 2
- WebAssembly HOT 5
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 duckscript.