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

Put result on standard out if no --output option specified? #15

Open
bertfrees opened this issue Oct 19, 2017 · 2 comments
Open

Put result on standard out if no --output option specified? #15

bertfrees opened this issue Oct 19, 2017 · 2 comments

Comments

@bertfrees
Copy link
Member

bertfrees commented Oct 19, 2017

This is how curl works. This would be a nice-to-have addition because this way you can do things like:

dp2 results --zipped myjob | unzip

This is a lame example because you can accomplish exactly the same with dp2 results myjob. But if the CLI would support downloading single files, not only ZIPs, it would open up more useful possibilities.

What's not so nice is that when you accidentally forget the --output argument you get a lot of output in your terminal, and in case of a ZIP, a lot of binary output. So maybe a better idea would be to do it the wget way, namely support - as your output file:

dp2 results --zipped --output - myjob

Currently this simply creates a ZIP file named "-". With the desired behavior the --zipped argument becomes redundant.

@bertfrees
Copy link
Member Author

Note that all other messages should be put on standard error.

@bertfrees
Copy link
Member Author

Similarly we could read from standard in if - is used instead of a file path, e.g. --source -.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant