From 945eecdadf5d620b72a95d0ada606fefb0d2ca18 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 4 Jul 2026 18:04:14 +0200 Subject: feat!: -v/--version prints tool version; hint version moves to -V/--set-version BREAKING CHANGE: the hint-version flag is now -V/--set-version. -v/--version now prints the tool's own version and exits. Co-Authored-By: Claude Opus 4.8 --- mkhint | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'mkhint') diff --git a/mkhint b/mkhint index 83f7840..d9a6c04 100755 --- a/mkhint +++ b/mkhint @@ -31,6 +31,8 @@ if [[ ! -d $TMP_DIR ]]; then mkdir $TMP_DIR fi +readonly MKHINT_VERSION="1.0.0" + # Variables VERSION="" HINT_FILE="" @@ -1006,14 +1008,18 @@ check_updates() { # Main function main() { local parsed - parsed=$(getopt -o v:f:n:lcCdNhRF \ - --long version:,hintfile:,new:,list,clean,check,delete,no-dl,help,review,fix-current \ + parsed=$(getopt -o vV:f:n:lcCdNhRF \ + --long version,set-version:,hintfile:,new:,list,clean,check,delete,no-dl,help,review,fix-current \ -n 'mkhint' -- "$@") || { show_help; exit 1; } eval set -- "$parsed" while true; do case "$1" in --version|-v) + echo "mkhint $MKHINT_VERSION" + exit 0 + ;; + --set-version|-V) VERSION="$2" shift 2 ;; @@ -1100,12 +1106,12 @@ main() { fi if [[ "$COMMAND" == "check" && ( -n "$VERSION" || -n "$HINT_FILE" || -n "$NEW_HINT_FILE" ) ]]; then - echo "Error: --check cannot be combined with --version/--hintfile/--new" >&2 + echo "Error: --check cannot be combined with --set-version/--hintfile/--new" >&2 exit 1 fi if [[ "$COMMAND" == "fix-current" && ( -n "$VERSION" || -n "$HINT_FILE" || -n "$NEW_HINT_FILE" ) ]]; then - echo "Error: --fix-current cannot be combined with --version/--hintfile/--new" >&2 + echo "Error: --fix-current cannot be combined with --set-version/--hintfile/--new" >&2 exit 1 fi -- cgit v1.2.3