Complete two-character option consistency across remaining scripts

🎯 Final Consistency Implementation:

 Updated Scripts:
  - sf-org-info: -to, -vb, -ls, -hp (fixed array handling + options)
  - sf-check: -vb, -hp (environment verification)
  - sf-apex-run: -to, -fl, -cd, -hp (Apex execution)
  - sf-retrieve: -to, -tp, -nm, -mn, -pk, -dr, -hp (metadata retrieval)
  - sf-test-run: -to, -cn, -sn, -al, -lv, -cv, -wt, -hp (test execution)

🔧 Key Changes:
  - Replaced ALL single-character options with two-character equivalents
  - Updated argument parsing from getopts to manual parsing
  - Fixed help text and error messages to use new options
  - Updated example commands and references

📊 Consistency Status:
  - 12/12 scripts now use uniform two-character options
  - 0/12 scripts have conflicting option styles
  - 100% consistency achieved across entire toolkit

🚀 Benefits Delivered:
  - No more confusion between scripts
  - Predictable and self-documenting options
  - Professional user experience
  - Ready for production deployment
This commit is contained in:
reynold
2025-08-28 19:04:07 +08:00
parent e82de4ea12
commit f22a46d711
5 changed files with 310 additions and 89 deletions

View File

@@ -13,11 +13,11 @@ show_help() {
sf-check — verify Salesforce CLI environment and configuration
USAGE:
sf-check [-v] [-h]
sf-check [-vb] [-hp]
OPTIONS:
-v Verbose output (show detailed information)
-h Show this help
-vb Verbose output (show detailed information)
-hp Show this help
DESCRIPTION:
This script verifies that the Salesforce CLI is properly installed and configured.
@@ -29,7 +29,7 @@ DESCRIPTION:
EXAMPLES:
sf-check # Basic environment check
sf-check -v # Verbose output with detailed information
sf-check -vb # Verbose output with detailed information
EOF
}
@@ -207,11 +207,29 @@ run_diagnostics() {
# Parse command line arguments
VERBOSE=false
while getopts ":vh" opt; do
case "$opt" in
v) VERBOSE=true ;;
h) show_help; exit 0 ;;
\?) echo "Unknown option: -$OPTARG" >&2; echo; show_help; exit 1 ;;
# Parse arguments manually for two-character options
while [[ $# -gt 0 ]]; do
case $1 in
-vb|--verbose)
VERBOSE=true
shift
;;
-hp|--help)
show_help
exit 0
;;
-*)
echo "Unknown option: $1" >&2
echo
show_help
exit 1
;;
*)
echo "Unexpected argument: $1" >&2
echo
show_help
exit 1
;;
esac
done
@@ -255,7 +273,7 @@ main() {
if [[ "$VERBOSE" != "true" ]]; then
echo ""
echo "Run 'sf-check -v' for detailed system information."
echo "Run 'sf-check -vb' for detailed system information."
fi
fi
}