Skip to content

feat: add a --quiet option to the get command - #132

Merged
roxblnfk merged 3 commits into
php-internal:1.xfrom
phenaproxima:add-get-quiet-option
Oct 5, 2026
Merged

roxblnfk merged 3 commits into
php-internal:1.xfrom
phenaproxima:add-get-quiet-option

Conversation

@phenaproxima

Copy link
Copy Markdown
Contributor

🔍 What was changed

  • dload get now has a -q / --quiet option. When it's set and there's nothing to download — no actions in the config and no software named on the command line — the command exits with status 0 and prints nothing.
  • Without --quiet, that same situation is still an error (No software to download.), so existing behavior doesn't change unless you opt in.
  • An explicitly named config file that's missing (--config=missing.xml) is still an error, --quiet or not. Only the "nothing to do" case is softened.

Why?

This makes DLoad easier to wire into automated setups that may or may not have anything to download. Today dload get fails loudly when there's no work, which forces callers to check first or swallow the error themselves. With --quiet they can just run it and let it succeed silently. Closes #127.

Checklist

  • How was this tested:
    • Integration tests added — this is the first command-level test for get, covering the quiet success, the default error, and the missing-config guard
    • Full unit and integration suites green, Psalm clean, php-cs-fixer clean
    • Tested manually: no config exits 0, an explicit missing config exits 1, and a real download proceeds normally

Review notes

  • The CommandTester harness doesn't catch exceptions, so the error cases assert via Expect::exception rather than an exit code.
  • This PR was created by AI under human supervision.

When --quiet (-q) is passed and there is no software to download (empty
or absent config, no CLI arguments), get now exits with status 0 and no
output instead of throwing "No software to download.". An explicitly
named but missing config file is still an error, as is any real
download.

Adds the first command-level test for the get command.
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/Command/Get.php 40.69% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

phenaproxima and others added 2 commits October 4, 2026 21:12
test(get): run the command through ApplicationTester
docs: document --quiet in the get options table

Symfony Console already defines --quiet|-q for every command, so the duplicate declaration only survived because the definitions happened to match, and its help text never showed. CommandTester skips Application::configureIO(), so the tests could not see the global flag.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk merged commit c9217e3 into php-internal:1.x Oct 5, 2026
20 of 21 checks passed
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

Successfully merging this pull request may close these issues.

Add a --quiet option to silently exit if there's no work to be done

2 participants