Implement innovative two-character option scheme

- Replace single-character options with memorable two-character alternatives
- Based on syllable mapping: -to (target-org), -qy (query), -fm (format), etc.
- Updated all bash and PowerShell scripts with consistent options
- Added comprehensive documentation and examples to README.md
- Maintains backward compatibility with long options
- More intuitive and self-documenting than traditional CLI options
This commit is contained in:
reynold
2025-08-28 18:11:08 +08:00
parent d919e5cfb8
commit 628fe95b50
11 changed files with 206 additions and 132 deletions

View File

@@ -20,22 +20,22 @@ show_usage() {
echo " sf-data-export [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " -q, --query QUERY SOQL query to export data"
echo " -f, --file FILE File containing SOQL query"
echo " -s, --sobject SOBJECT Standard object query (exports all records)"
echo " -o, --output FILE Output file path (default: export.csv)"
echo " -t, --target-org ORG Target org username or alias"
echo " --format FORMAT Output format: csv, json (default: csv)"
echo " --bulk Use bulk API for large datasets"
echo " --wait MINUTES Wait time in minutes (default: 10)"
echo " -v, --verbose Enable verbose output"
echo " -h, --help Show this help message"
echo " -qy, --query QUERY SOQL query to export data"
echo " -fl, --file FILE File containing SOQL query"
echo " -so, --sobject SOBJECT Standard object query (exports all records)"
echo " -to, --target-org ORG Target org username or alias"
echo " -ot, --output FILE Output file path (default: export.csv)"
echo " -fm, --format FORMAT Output format: csv, json (default: csv)"
echo " -bk, --bulk Use bulk API for large datasets"
echo " -wt, --wait MINUTES Wait time in minutes (default: 10)"
echo " -vb, --verbose Enable verbose output"
echo " -hp, --help Show this help message"
echo ""
echo "EXAMPLES:"
echo " sf-data-export --query \"SELECT Id, Name FROM Account LIMIT 100\""
echo " sf-data-export --sobject Account --format json --output accounts.json"
echo " sf-data-export --file queries/contacts.soql --bulk --wait 15"
echo " sf-data-export --query \"SELECT Id FROM User\" --target-org production"
echo " sf-data-export -qy \"SELECT Id, Name FROM Account LIMIT 100\""
echo " sf-data-export -so Account -fm json -ot accounts.json"
echo " sf-data-export -fl queries/contacts.soql -bk -wt 15"
echo " sf-data-export -qy \"SELECT Id FROM User\" -to production"
echo ""
echo "This script automatically checks for Salesforce CLI installation."
}
@@ -123,43 +123,43 @@ VERBOSE=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-q|--query)
-qy|--query)
QUERY="$2"
shift 2
;;
-f|--file)
-fl|--file)
QUERY_FILE="$2"
shift 2
;;
-s|--sobject)
-so|--sobject)
SOBJECT="$2"
shift 2
;;
-o|--output)
OUTPUT_FILE="$2"
shift 2
;;
-t|--target-org)
-to|--target-org)
TARGET_ORG="$2"
shift 2
;;
--format)
-ot|--output)
OUTPUT_FILE="$2"
shift 2
;;
-fm|--format)
FORMAT="$2"
shift 2
;;
--bulk)
-bk|--bulk)
USE_BULK=true
shift
;;
--wait)
-wt|--wait)
WAIT_TIME="$2"
shift 2
;;
-v|--verbose)
-vb|--verbose)
VERBOSE=true
shift
;;
-h|--help)
-hp|--help)
show_usage
exit 0
;;