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

@@ -9,40 +9,40 @@
from Salesforce orgs with SOQL query support, multiple formats, and intelligent defaults.
.PARAMETER Query
SOQL query to export data
SOQL query to export data (alias: -qy)
.PARAMETER File
File containing SOQL query
File containing SOQL query (alias: -fl)
.PARAMETER SObject
Standard object query (exports common fields)
Standard object query (exports common fields) (alias: -so)
.PARAMETER Output
Output file path (default: export.csv)
Output file path (default: export.csv) (alias: -ot)
.PARAMETER TargetOrg
Target org username or alias
Target org username or alias (alias: -to)
.PARAMETER Format
Output format: csv, json (default: csv)
Output format: csv, json (default: csv) (alias: -fm)
.PARAMETER Bulk
Use bulk API for large datasets
Use bulk API for large datasets (alias: -bk)
.PARAMETER Wait
Wait time in minutes (default: 10)
Wait time in minutes (default: 10) (alias: -wt)
.PARAMETER Verbose
Enable verbose output
Enable verbose output (alias: -vb)
.PARAMETER Help
Show this help message
Show this help message (alias: -hp)
.EXAMPLE
.\sf-data-export.ps1 -Query "SELECT Id, Name FROM Account LIMIT 100"
.\sf-data-export.ps1 -SObject Account -Format json -Output accounts.json
.\sf-data-export.ps1 -File queries/contacts.soql -Bulk -Wait 15
.\sf-data-export.ps1 -Query "SELECT Id FROM User" -TargetOrg production
.\sf-data-export.ps1 -qy "SELECT Id, Name FROM Account LIMIT 100"
.\sf-data-export.ps1 -so Account -fm json -ot accounts.json
.\sf-data-export.ps1 -fl queries/contacts.soql -bk -wt 15
.\sf-data-export.ps1 -qy "SELECT Id FROM User" -to production
.NOTES
This script automatically checks for Salesforce CLI installation and runs
@@ -51,21 +51,37 @@
param(
[Parameter(ParameterSetName="Query")]
[Alias("qy")]
[string]$Query,
[Parameter(ParameterSetName="File")]
[Alias("fl")]
[string]$File,
[Parameter(ParameterSetName="SObject")]
[Alias("so")]
[string]$SObject,
[Alias("ot")]
[string]$Output = "export.csv",
[Alias("to")]
[string]$TargetOrg,
[ValidateSet("csv", "json")]
[Alias("fm")]
[string]$Format = "csv",
[Alias("bk")]
[switch]$Bulk,
[Alias("wt")]
[int]$Wait = 10,
[Alias("vb")]
[switch]$Verbose,
[Alias("hp")]
[switch]$Help
)