Skip to content

Comments

Add --version flag with -V alias via QCommandLineParser#140

Open
nerdCopter wants to merge 5 commits intofstl-app:masterfrom
nerdCopter:feat/version-flag
Open

Add --version flag with -V alias via QCommandLineParser#140
nerdCopter wants to merge 5 commits intofstl-app:masterfrom
nerdCopter:feat/version-flag

Conversation

@nerdCopter
Copy link

@nerdCopter nerdCopter commented Jan 17, 2026

Implement version flag handling using Qt's QCommandLineParser with cross-platform tests.

Changes

  • Replace manual argv parsing with QCommandLineParser
  • Support --version and -V (POSIX-compliant) for version output
  • Enable version tests on all platforms (remove WIN32 restriction)
  • Rename tests: version_check (--version) and version_check_V (-V)

Benefits

  • Qt best practices
  • Cross-platform support
  • Automatic --help generation
  • POSIX conventions

nerdCopter added 2 commits January 17, 2026 13:33
Print 'fstl <version>' and exit for --version/-V; use raw argv checks for robustness; add CTest entries to validate outputs.
Recognize --version, -V, and -v; add CTest to validate -v output; use literal '.' matching in version regex and skip tests on WIN32.
Implement POSIX-compliant version handling using QCommandLineParser:

Changes:
- Enable version tests on all platforms (remove WIN32 restriction)
- Use QCommandLineParser for proper --help, -h, and --version handling
- Support -V (uppercase, POSIX-compliant) and --version for version output
- Remove -v (lowercase) to follow POSIX conventions (typically reserved for verbose)
- Tests: version_check (--version) and version_check_V (-V) on all platforms

Benefits:
- Cross-platform compatibility (Windows, Linux, macOS)
- Qt best practices with QCommandLineParser
- No hardcoded program name or version (uses CMake PROJECT_VERSION)
- Proper --help output with option documentation
- All values sourced from QCoreApplication and CMake configuration
@nerdCopter nerdCopter changed the title Add --version flag with -V/-v aliases and tests Add --version flag with -V alias via QCommandLineParser Jan 18, 2026
@nerdCopter
Copy link
Author

Pushed.
AI‑assisted code generation.
Please check expediencies.

nerdCopter and others added 2 commits January 19, 2026 15:21
Co-authored-by: Paul T <6591180+ptsouchlos@users.noreply.github.com>
Use standard iostream streams instead of C-style printf for version output, improving consistency with modern C++ practices.
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.

2 participants