Add GNU-style long-form aliases for all CLI flags

All flags in fido2-manage.sh and fido2-manage-mac.sh now accept both
single-dash (-flag) and double-dash (--flag) forms, e.g. --device,
--list, --help. Single-dash forms continue to work unchanged.
This commit is contained in:
Tamir Suliman
2026-06-06 12:33:35 +02:00
parent b0544044da
commit 9bec9fe41b
2 changed files with 35 additions and 35 deletions

View File

@@ -28,23 +28,23 @@ show_message() {
while [[ "$#" -gt 0 ]]; do
case $1 in
-list) list=true ;;
-info) info=true ;;
-device) device="$2"; shift ;;
-pin) pin="$2"; shift ;;
-storage) storage=true ;;
-fingerprint) fingerprint=true ;;
-residentKeys) residentKeys=true ;;
-domain) domain="$2"; shift ;;
-delete) delete=true ;;
-credential) credential="$2"; shift ;;
-changePIN) changePIN=true ;;
-setPIN) setPIN=true ;;
-reset) reset=true ;;
-setMinimumPIN) setMinimumPIN="$2"; shift ;;
-uvs) uvs=true ;;
-uvd) uvd=true ;;
-help) help=true ;;
-list|--list) list=true ;;
-info|--info) info=true ;;
-device|--device) device="$2"; shift ;;
-pin|--pin) pin="$2"; shift ;;
-storage|--storage) storage=true ;;
-fingerprint|--fingerprint) fingerprint=true ;;
-residentKeys|--residentKeys) residentKeys=true ;;
-domain|--domain) domain="$2"; shift ;;
-delete|--delete) delete=true ;;
-credential|--credential) credential="$2"; shift ;;
-changePIN|--changePIN) changePIN=true ;;
-setPIN|--setPIN) setPIN=true ;;
-reset|--reset) reset=true ;;
-setMinimumPIN|--setMinimumPIN) setMinimumPIN="$2"; shift ;;
-uvs|--uvs) uvs=true ;;
-uvd|--uvd) uvd=true ;;
-help|--help) help=true ;;
*) show_message "Unknown parameter: $1" "Error"; exit 1 ;;
esac
shift