CLI: Improve argument parsing & console output formatting #1014
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve behavior of argument parser
--arg value
in addition to--arg=value
.--help
page (to keep the focus on the error message).--help-all
which was automatically added by Qt but is not really useful.-?
which was automatically added by Qt, but only on Windows. Removing it to keep the options identical across all operating systems.Print file format version in "--version" output
In some cases, not the application version but only the file format version is of interest so let's print that number.
Output any file paths with native separators
On Windows, output filepaths in stdout and stderr with backslash as directory separator. Just for consistency with other Windows applications.
Fix inconsistent quoting of filepaths in output
In stdout/stderr, consistently quote filepaths with single ticks (') to improve readability of paths which contain whitespaces.
Functional tests: Add many more CLI tests
Added tests for more commands, and now testing the exact output of stdout and stderr. Might be a bit annoying when modifying the output formatting since many tests might be affected, but I think it helps to detect issues like the inconsistent formatting/quoting, unintended Qt arguments etc.
CI: Run functional CLI tests with "-vvv"
Helps to debug failed tests on CI - especially useful since many more text comparisons are now made where we want to see the exact diff on failure.