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,23 +20,23 @@ show_usage() {
echo " sf-data-import [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " -f, --file FILE CSV or JSON file to import"
echo " -s, --sobject SOBJECT Target sObject type"
echo " -o, --operation OP Operation: insert, update, upsert (default: insert)"
echo " -e, --external-id FIELD External ID field for upsert/update operations"
echo " -t, --target-org ORG Target org username or alias"
echo " --bulk Use bulk API for large datasets"
echo " --wait MINUTES Wait time in minutes (default: 10)"
echo " --batch-size SIZE Batch size for bulk operations (default: 10000)"
echo " --ignore-errors Continue on errors (don't fail entire job)"
echo " -v, --verbose Enable verbose output"
echo " -h, --help Show this help message"
echo " -fl, --file FILE CSV or JSON file to import"
echo " -so, --sobject SOBJECT Target sObject type"
echo " -to, --target-org ORG Target org username or alias"
echo " -op, --operation OP Operation: insert, update, upsert (default: insert)"
echo " -ei, --external-id FIELD External ID field for upsert/update operations"
echo " -bk, --bulk Use bulk API for large datasets"
echo " -wt, --wait MINUTES Wait time in minutes (default: 10)"
echo " -bs, --batch-size SIZE Batch size for bulk operations (default: 10000)"
echo " -ie, --ignore-errors Continue on errors (don't fail entire job)"
echo " -vb, --verbose Enable verbose output"
echo " -hp, --help Show this help message"
echo ""
echo "EXAMPLES:"
echo " sf-data-import --file accounts.csv --sobject Account"
echo " sf-data-import --file contacts.json --sobject Contact --operation upsert --external-id Email"
echo " sf-data-import --file leads.csv --sobject Lead --bulk --batch-size 5000"
echo " sf-data-import --file updates.csv --sobject Account --operation update --external-id AccountNumber"
echo " sf-data-import -fl accounts.csv -so Account"
echo " sf-data-import -fl contacts.json -so Contact -op upsert -ei Email"
echo " sf-data-import -fl leads.csv -so Lead -bk -bs 5000"
echo " sf-data-import -fl updates.csv -so Account -op update -ei AccountNumber"
echo ""
echo "SUPPORTED FORMATS:"
echo " • CSV files with header row"
@@ -171,47 +171,47 @@ VERBOSE=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-f|--file)
-fl|--file)
FILE="$2"
shift 2
;;
-s|--sobject)
-so|--sobject)
SOBJECT="$2"
shift 2
;;
-o|--operation)
OPERATION="$2"
shift 2
;;
-e|--external-id)
EXTERNAL_ID="$2"
shift 2
;;
-t|--target-org)
-to|--target-org)
TARGET_ORG="$2"
shift 2
;;
--bulk)
-op|--operation)
OPERATION="$2"
shift 2
;;
-ei|--external-id)
EXTERNAL_ID="$2"
shift 2
;;
-bk|--bulk)
USE_BULK=true
shift
;;
--wait)
-wt|--wait)
WAIT_TIME="$2"
shift 2
;;
--batch-size)
-bs|--batch-size)
BATCH_SIZE="$2"
shift 2
;;
--ignore-errors)
-ie|--ignore-errors)
IGNORE_ERRORS=true
shift
;;
-v|--verbose)
-vb|--verbose)
VERBOSE=true
shift
;;
-h|--help)
-hp|--help)
show_usage
exit 0
;;