Feature request: Add a --version parameter #364

Closed
opened 2025-11-20 04:23:11 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @yorickdowne on GitHub (Feb 5, 2024).

  1. What's the feature?

I'd be helpful to be able to call /updater/app --version and have it print out its version and quit.

This would assist us in our Ansible/IaC rollout, where we use this as a sanity check for the tech running the Ansible playbook

Originally created by @yorickdowne on GitHub (Feb 5, 2024). 1. What's the feature? I'd be helpful to be able to call `/updater/app --version` and have it print out its version and quit. This would assist us in our Ansible/IaC rollout, where we use this as a sanity check for the tech running the Ansible playbook
saavagebueno added the Category: Good idea 🎯Complexity: 🟩 Easy to do labels 2025-11-20 04:23:11 -05:00
Author
Owner

@qdm12 commented on GitHub (Feb 8, 2024):

Sure! I have some code doing the following:

if the first argument to the program is version, -version or --version, print on a new line:

  • v2.6.0 if the version is set (only set on releases)
  • latest-0abcdef for commits on the master branch
  • unknown if the version is not set at all, for example when building the program locally

Would that work/suffice?

I could eventually have it as v2.6.0-0abcdef for a commit after a certain release, but that is tedious to get right (and have the CI enforce this is properly hardcoded in the code etc.)

@qdm12 commented on GitHub (Feb 8, 2024): Sure! I have some code doing the following: if the first argument to the program is `version`, `-version` or `--version`, print on a new line: - `v2.6.0` if the version is set (only set on releases) - `latest-0abcdef` for commits on the master branch - `unknown` if the version is not set at all, for example when building the program locally Would that work/suffice? I could eventually have it as `v2.6.0-0abcdef` for a commit after a certain release, but that is tedious to get right (and have the CI enforce this is properly hardcoded in the code etc.)
Author
Owner

@yorickdowne commented on GitHub (Feb 8, 2024):

That’s great. No need to cut a release just for this feature.

@yorickdowne commented on GitHub (Feb 8, 2024): That’s great. No need to cut a release just for this feature.
Author
Owner

@qdm12 commented on GitHub (Feb 8, 2024):

Actually I went ahead to work on having:

  • v2.6.0 for releases commits
  • v2.6.0-aef1234 for commits after release v2.6.0 (and before v2.7.0)

I'll let you know once it's ready.

@qdm12 commented on GitHub (Feb 8, 2024): Actually I went ahead to work on having: - v2.6.0 for releases commits - v2.6.0-aef1234 for commits after release v2.6.0 (and before v2.7.0) I'll let you know once it's ready.
Author
Owner

@qdm12 commented on GitHub (Feb 8, 2024):

Done in 4499d87e05

In the end, I reverted since it was getting over-complicated to keep track of the previous last release. So it's again:

  • v2.6.0 if the version is set (only set on releases)
  • latest-0abcdef for commits on the master branch
  • unknown if the version is not set at all, for example when building the program locally
@qdm12 commented on GitHub (Feb 8, 2024): Done in 4499d87e05cea31e13ce987929b94a1097a43de0 In the end, I reverted since it was getting over-complicated to keep track of the previous last release. So it's again: - `v2.6.0` if the version is set (only set on releases) - `latest-0abcdef` for commits on the master branch - `unknown` if the version is not set at all, for example when building the program locally
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#364