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

[FR] Add "standard" return codes to environmental exit/termination #560

Open
Kein opened this issue Nov 3, 2024 · 2 comments
Open

[FR] Add "standard" return codes to environmental exit/termination #560

Kein opened this issue Nov 3, 2024 · 2 comments

Comments

@Kein
Copy link

Kein commented Nov 3, 2024

What problem is this feature trying to solve?

Because parsing stdout text is pain when you use DD as cli tool and not a lib.

How would you like it to be solved?

By returning more or less "standardized" return codes for successful or failed operations.

Have you considered any alternative solutions

I stand corrected, parsing stdout is a MASSIVE pain.

Additional Information

Ackchyually, there are no standartized return codes between Linux/Windows, therefore...

Old, as Earth, and a meaningless argument, but her we go:
Sure, there aren't, but there is an overlap:

  • WINDOWS has massive code catalog
  • LINUX has only a few "reserved"

and because Linux is very lenient in this regard, and gives you pretty much unbound freedom to use any "unreserved" in anyway you want - there could be a free substitute for Linux return code responses (i.e. you can use window's 13 on Linux too).

Minimum effort mode:
Just return anything but 0 for any failed operation. Example:

  1. User wants to download game/file
  2. User initiates a download
  3. DD either successfully downloads and writes a file (transient errors in-between are ignored) or validates existing cache and finds no changes/up-to-date
  4. DD returns with 0
  5. If DD fails to successfully execute #​4 (including even just failing at parsing cmd args) it returns with code > 0
@xPaw
Copy link
Member

xPaw commented Nov 14, 2024

Can you give a concrete example of when it fails to download but returns 0? Most code paths seem to return 1 for errors.

@Kein
Copy link
Author

Kein commented Nov 14, 2024

The last one I encountered was when it failed to connect to Steam or had a hard failure during download process.

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

2 participants