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

jobs: suppress "No suitable job" if -q is given #6812

Merged
merged 1 commit into from Mar 26, 2020
Merged

jobs: suppress "No suitable job" if -q is given #6812

merged 1 commit into from Mar 26, 2020

Conversation

soumya92
Copy link
Contributor

@soumya92 soumya92 commented Mar 26, 2020

Description

This allows code of the form if jobs -q $some_pid in scripts to check whether a previously started job is still running. Previously this would return the correct value, but also print an error message.

The invalid argument errors will still be printed.
Added test cases for both.

Fixes issue #6809

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
    Sort of. The documentation already describes the expected behaviour:

    -q or --quiet prints no output for evaluation of jobs by exit status only

  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md

This allows code of the form `if jobs -q $some_pid` in scripts to check whether a previously started job is still running. Previously this would return the correct value, but also print an error message.

The invalid argument errors will still be printed.
Added test cases for both.
@faho faho added the bug Something that's not working as intended label Mar 26, 2020
@faho faho added this to the fish 3.2.0 milestone Mar 26, 2020
@faho faho linked an issue Mar 26, 2020 that may be closed by this pull request
@faho faho merged commit 96563d6 into fish-shell:master Mar 26, 2020
@faho
Copy link
Member

faho commented Mar 26, 2020

Yeah, that'll do the trick. Thanks!

@soumya92 soumya92 deleted the quieter-jobs-builtin branch March 26, 2020 17:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jobs ignores -q for invalid PIDs
2 participants