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

Unify errors and exit codes of query commands #1075

Open
pkratoch opened this issue Dec 8, 2023 · 1 comment
Open

Unify errors and exit codes of query commands #1075

pkratoch opened this issue Dec 8, 2023 · 1 comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@pkratoch
Copy link
Contributor

pkratoch commented Dec 8, 2023

The behavior of query commands should be unified in these cases:

  1. Output is empty because of e.g. no repositories are enabled.
  2. Output is empty because the argument doesn't match anything.
  3. Some arguments match, but some don't.

These commands currently in all the cases return exit code 0 and don't print any error message:

  • advisory list
  • advisory info
  • environment list
  • environment info
  • group list
  • group info
  • repo list
  • repo info
  • repoquery
  • copr list (considering only 1st case, since this command doesn't accept arguments)

These commands are different:

  • module list and module info
    • exit code 0
    • in case there is an unmatched argument, it prints a message on stderr
  • provides (considering only 2nd and 3rd case, since this command doesn't work without arguments)
    • exit code 1
    • in case there is an unmatched argument, it prints a message on stderr

Search is not included, as it's a little bit different. Similar is also repoquery. It might make sense for these to behave differently.

@pkratoch
Copy link
Contributor Author

pkratoch commented Dec 8, 2023

I am not sure about exit codes, but I think a message on stderr about unmatched arguments would be good in all cases. Not sure about repoquery, though.

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Dec 11, 2023
@jan-kolarik jan-kolarik added Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Dec 11, 2023
kontura added a commit to kontura/ci-dnf-stack that referenced this issue Nov 12, 2024
dnf5 exits with 0, unlike dnf4.

There is a general issue about exit codes of query commands:
rpm-software-management/dnf5#1075
kontura added a commit to kontura/ci-dnf-stack that referenced this issue Nov 12, 2024
dnf5 exits with 0, unlike dnf4.

There is a general issue about exit codes of query commands:
rpm-software-management/dnf5#1075
kontura added a commit to kontura/ci-dnf-stack that referenced this issue Nov 13, 2024
dnf5 exits with 0, unlike dnf4.

There is a general issue about exit codes of query commands:
rpm-software-management/dnf5#1075
kontura added a commit to kontura/ci-dnf-stack that referenced this issue Nov 13, 2024
dnf5 exits with 0, unlike dnf4.

There is a general issue about exit codes of query commands:
rpm-software-management/dnf5#1075
pkratoch pushed a commit to rpm-software-management/ci-dnf-stack that referenced this issue Nov 13, 2024
dnf5 exits with 0, unlike dnf4.

There is a general issue about exit codes of query commands:
rpm-software-management/dnf5#1075
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Status: Backlog
Development

No branches or pull requests

2 participants