Enforce strict two-character option scheme across all wrapper scripts

- Removed long options from input parsing in all bash scripts
- Updated all help texts to show only two-character options
- Fixed error messages to reference short options only
- All scripts now reject long options like --help, --verbose, --target-org
- Maintained internal use of long sf CLI commands (e.g., --target-org passed to sf)
- Updated README.md documentation to reflect two-character scheme only
- Scripts affected: sf-retrieve, sf-test-run, sf-data-import, sf-data-export
- PowerShell scripts already used correct two-character parameter scheme
- All wrapper scripts now have consistent user interface

This ensures strict consistency in the two-character option scheme
while maintaining backward compatibility for the sf CLI commands themselves.
This commit is contained in:
reynold
2025-08-28 22:07:34 +08:00
parent 7aa7a7a688
commit 1ae8df8561
9 changed files with 89 additions and 89 deletions

View File

@@ -9,13 +9,13 @@ USAGE:
sf-retrieve -to <ORG_ALIAS> (-tp <TYPES> | -mn <MANIFEST> | -pk <PACKAGE>) [-nm <NAMES>] [-dr <DIR>] [-hp]
OPTIONS:
-to, --target-org Org alias or username to retrieve from (required)
-tp, --types Comma-separated metadata types (ApexClass,CustomObject,Flow,etc.)
-nm, --names Comma-separated component names (optional, works with -tp)
-mn, --manifest Path to manifest file (package.xml)
-pk, --package Package name to retrieve
-dr, --directory Target directory for retrieved metadata (default: force-app)
-hp, --help Show this help
-to Org alias or username to retrieve from (required)
-tp Comma-separated metadata types (ApexClass,CustomObject,Flow,etc.)
-nm Comma-separated component names (optional, works with -tp)
-mn Path to manifest file (package.xml)
-pk Package name to retrieve
-dr Target directory for retrieved metadata (default: force-app)
-hp Show this help
EXAMPLES:
1) Retrieve all Apex classes:
@@ -68,7 +68,7 @@ fi
# Parse arguments manually for two-character options
while [[ $# -gt 0 ]]; do
case $1 in
-to|--target-org)
-to)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
ORG="$2"
shift 2
@@ -78,7 +78,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-tp|--types)
-tp)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
TYPES="$2"
shift 2
@@ -88,7 +88,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-nm|--names)
-nm)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
NAMES="$2"
shift 2
@@ -98,7 +98,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-mn|--manifest)
-mn)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
MANIFEST="$2"
shift 2
@@ -108,7 +108,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-pk|--package)
-pk)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
PACKAGE="$2"
shift 2
@@ -118,7 +118,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-dr|--directory)
-dr)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
TARGET_DIR="$2"
shift 2
@@ -128,7 +128,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
-hp|--help)
-hp)
show_help
exit 0
;;