aboutsummaryrefslogtreecommitdiffstats
path: root/mkhint
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-07 18:58:35 +0200
committerDanilo M. <danix@danix.xyz>2026-07-07 18:59:20 +0200
commit2841638a0146982322b53db7c305bdeb84456249 (patch)
tree12ddae7a539c9b75f13fb71a325b8b34220df5aa /mkhint
parenta6bbb96d31fb1df707ba3eea182e68b2f1c35552 (diff)
downloadmkhintfile-2841638a0146982322b53db7c305bdeb84456249.tar.gz
mkhintfile-2841638a0146982322b53db7c305bdeb84456249.zip
feat: add --force flag (check-only, mutually exclusive elsewhere)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
-rwxr-xr-xmkhint12
1 files changed, 11 insertions, 1 deletions
diff --git a/mkhint b/mkhint
index e8cbb00..990eeb3 100755
--- a/mkhint
+++ b/mkhint
@@ -59,6 +59,7 @@ SHOW_LIST=""
RUN_REVIEW=""
COMMAND=""
NO_DL=0
+FORCE=0
# Show help message
show_help() {
@@ -1247,7 +1248,7 @@ check_updates() {
main() {
local parsed
parsed=$(getopt -o vV:f:n:lcCdNhRF \
- --long version,set-version:,hintfile:,new:,list,clean,check,delete,no-dl,help,review,fix-current \
+ --long version,set-version:,hintfile:,new:,list,clean,check,delete,no-dl,help,review,fix-current,force \
-n 'mkhint' -- "$@") || { show_help; exit 1; }
eval set -- "$parsed"
@@ -1297,6 +1298,10 @@ main() {
NO_DL=1
shift
;;
+ --force)
+ FORCE=1
+ shift
+ ;;
--help|-h)
COMMAND="help"
shift
@@ -1353,6 +1358,11 @@ main() {
exit 1
fi
+ if [[ $FORCE -eq 1 && "$COMMAND" != "check" ]]; then
+ echo "Error: --force is only valid with --check" >&2
+ exit 1
+ fi
+
if [[ -n "$SHOW_LIST" && ${#LIST_PKGS[@]} -gt 0 ]]; then
local p
for p in "${LIST_PKGS[@]}"; do