Skip to content

Add --version option - #40

Merged
MonoS merged 6 commits into
MonoS:masterfrom
maghuro:feature/version-option
Sep 30, 2026
Merged

MonoS merged 6 commits into
MonoS:masterfrom
maghuro:feature/version-option

Conversation

@maghuro

@maghuro maghuro commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a dedicated --version command that prints the current SupMover version and exits successfully.

Currently, invoking SupMover with a single argument falls through to the usage path, so tools that need to detect the installed version have to parse the first line of the full help text while the process exits with 255.

This change:

  • adds SupMover --version, which prints only SupMover v2.5.1 and exits with code 0;
  • defines SUPMOVER_VERSION once and reuses it in both --version output and the usage header;
  • documents the new command in the README;
  • intentionally leaves -v unassigned, so it remains available for a possible future --verbose shorthand as previously discussed in Dash prefix for options & Prettier usage #17.

Validation

  • make succeeds;
  • ./supmover --version prints exactly SupMover v2.5.1 and exits 0;
  • the output ends with a normal newline;
  • invoking SupMover without arguments preserves the existing help output and exit status.

The compiler warnings shown by the current build are pre-existing and unrelated to this change.

@MonoS

MonoS commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Hi, I don't see any issue in merging that, but i kindly ask you to also add the version, without dashes, option, as i'm using both of them in the codebase.

Just curios what other project is this needed for?

@maghuro

maghuro commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Sure, added version as an alias for --version and documented both forms.

As for the use case: I have a personal system maintenance/update tool called upall that checks installed versions of several external tools against their upstream releases. SupMover was a bit awkward to detect programmatically because the version was only available through the usage output, which exits non-zero.

I also use SupMover as part of my personal project FIXE, a CLI/TUI workflow for normalising Matroska metadata and track layout and for processing PGS subtitles (crop/move/tonemapping). Fixe integrates SupMover for the PGS operations, so having a clean version command also makes that integration easier to manage.

Thanks!

@MonoS
MonoS merged commit 67a067e into MonoS:master Sep 30, 2026
@maghuro
maghuro deleted the feature/version-option branch September 30, 2026 20:59
@MonoS

MonoS commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Thanks, merged and published a new version

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