Comments (9)
another perhaps pertinent consideration could be how errors are communicated to the caller in bash
In case of errors it exits from the application with code 1
every time.
If some unexpected calling format has been given, we print the manual of the command which went wrong and the error message in the last row.
The Other case, when the run()
method fails we print an error message with red colors, maybe with some info at the end, which depends on the verbosity level. It also throws 1
error code, that the CLI can react on (you can try out by calling swarm-cli upload some/folder/path && echo 'successful run'
.
from swarm-cli.
there is also the example of curl which is semi-verbose as default but has a -s option for automated use
as I mentioned in my comment #26 (comment) verbosity 0 is for automated usage. nevertheless if it is not intuitive for most of the users, we may introduce an alias for -v 0
.
from swarm-cli.
In many CLI tools I worked with there was a -q
or --quiet
option for minimal output and the -v
or --verbose
option for the verbose output. We can adopt that.
from swarm-cli.
Personally I think that the verbose version should be kept default because it continuously informs the user what is happening which is always good.
from swarm-cli.
I would argue that the common approach to this from pretty all CLI applications and especially UNIX utilities are that you output only "the results" and have flags like -v
to enable more details. This is especially important if you want to use it in some scripts and use piping to other commands. From this perspective it would be good to also have flag like --no-color
or something like that, that would strip the colors chars from the stdout, but I guess it is not as critical.
I can imagine use cases like swarm-cli upload /some/dir | mail [email protected]
which won't be possible if you can't get only the resulting hash.
from swarm-cli.
for that to set verbosity to 0 would be the way to do, because provide totally silent option is non-sense.
on upload verbosity 0 currently gives back the uploaded hash of the content, but unfortunately it also prints the progress bar which ruins this behaviour and it is not intended to be like this.
from swarm-cli.
+1 for automated use
there is also the example of curl
which is semi-verbose as default but has a -s
option for automated use
from swarm-cli.
another perhaps pertinent consideration could be how errors are communicated to the caller in bash, so that we can e.g. retry if upload fails when used in shell scripting
from swarm-cli.
The original issue about default verbosity is fixed, follow the discussion about the new options in #54
from swarm-cli.
Related Issues (20)
- Mixing `bignumber.js` and native `bigint`
- `Invalid time value` on feed upload
- Revamp testing console messages (get rid of exact indices)
- balance is NaN HOT 2
- feat: more estimates during stamp purchase
- Trying to upload a file and getting false == true error HOT 2
- Feature request: calculate Swarm reference hash of content HOT 2
- remove greater than 100mb?
- Feature - Dry run Upload with CLI HOT 1
- Allow toping up stamps generated on another node HOT 1
- if in ultralight node, swarm-cli reports incorrect error
- estimate TTL for stamp based on current price
- bzz.link link no longer works
- Unclear Error "Invalid time value"
- feed print incorrect Number of updates
- feat: "dry run" determine what the hash of content that will be uploaded will be HOT 1
- feat: modify v3 password
- feat: unlock v3 wallet
- feat: lock private key
- Readme minimum bee version?
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 swarm-cli.