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

returns 0 when file/stdin is empty with -i #637

Closed
AladW opened this issue Apr 26, 2016 · 2 comments
Closed

returns 0 when file/stdin is empty with -i #637

AladW opened this issue Apr 26, 2016 · 2 comments

Comments

@AladW
Copy link

AladW commented Apr 26, 2016

% touch foo
% aria2c -i foo
No files to download.
% echo $?
0

Compare to:

aria2 
zsh: correct 'aria2' to 'aria2c' [nyae]? y
Specify at least one URL.
Usage: aria2c [OPTIONS] [URI | MAGNET | TORRENT_FILE | METALINK_FILE]...
See 'aria2c -h'.
% echo $?
1

According to EXIT STATUS in aria2c(1), 0 means If all downloads were successful. You could argue that if there are no downloads to succeed, that then downloads are in fact successful; however this is a roundabout. I would suggest e.g. 3, If a resource was not found.

See also this discussion for wget (which unfortunately decided against a non-zero exit code):

http://www.mail-archive.com/wget@sunsite.dk/msg10655.html

@tatsuhiro-t
Copy link
Collaborator

I tend to leave exist status code as is. aria2 has relatively long history, so changing zero status code to nonzero may break existing third party code, and we'd like to avoid that.

@AladW
Copy link
Author

AladW commented Apr 26, 2016

Well, I don't have a suggestion to fit both cases. Thanks for considering.

@AladW AladW closed this as completed Apr 26, 2016
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

No branches or pull requests

2 participants