Standardize verbose parameter from -vb to -ve across all scripts

- Update all Bash scripts (sf-check, sf-org-info, sf-data-export, sf-data-import, sf-logs-tail) to use -ve instead of -vb
- Update all PowerShell scripts (sf-org-info.ps1, sf-apex-run.ps1, sf-check.ps1, sf-data-export.ps1, sf-data-import.ps1) to use -ve instead of -vb
- Fix PowerShell parameter conflicts with built-in -Verbose parameter
- Update README.md, TESTING.md, and OPTION_CONSISTENCY.md documentation to reflect -ve parameter
- Update test scripts (test-wrapper-suite.sh, test-wrapper-suite.ps1, test-all-wrappers.sh) to use -ve
- Maintain cross-platform consistency with two-character option scheme
- Fix Unicode display issues in PowerShell output with UTF-8 encoding
This commit is contained in:
Reynold Lariza
2025-08-28 20:47:46 +08:00
parent 579264e3d1
commit 159ede3794
16 changed files with 116 additions and 112 deletions

View File

@@ -9,26 +9,26 @@
quick access to org information, limits, and authentication status with
clean, formatted output.
.PARAMETER o
.PARAMETER to
Target org username or alias (uses default if not specified)
.PARAMETER Limits
.PARAMETER limits
Show detailed org limits information
.PARAMETER ListOrgs
.PARAMETER list
List all authenticated orgs
.PARAMETER Verbose
.PARAMETER ve
Enable verbose output with additional details
.PARAMETER Help
.PARAMETER hp
Show this help message
.EXAMPLE
.\sf-org-info.ps1
.\sf-org-info.ps1 -o "myorg" -Limits -Verbose
.\sf-org-info.ps1 -Limits
.\sf-org-info.ps1 -ListOrgs
.\sf-org-info.ps1 -to "myorg" -limits -ve
.\sf-org-info.ps1 -limits
.\sf-org-info.ps1 -list
.NOTES
This script automatically checks for Salesforce CLI installation and runs
@@ -36,15 +36,15 @@
#>
param(
[string]$o,
[switch]$Limits,
[switch]$ListOrgs,
[switch]$Verbose,
[switch]$Help
[string]$to,
[switch]$limits,
[switch]$list,
[switch]$ve,
[switch]$hp
)
# Show help if requested
if ($Help) {
if ($hp) {
Get-Help $MyInvocation.MyCommand.Path -Detailed
exit 0
}
@@ -86,9 +86,15 @@ function Invoke-SafeSfCommand {
Write-Host "Executing: sf $($Arguments -join ' ')" -ForegroundColor Gray
Write-Host ""
& sf @Arguments
# Execute the command and capture the output
$output = & sf @Arguments 2>&1
$exitCode = $LASTEXITCODE
# Display the output
if ($output) {
$output | ForEach-Object { Write-Host $_ }
}
if ($exitCode -ne 0) {
Write-Host ""
Write-Host "❌ Command failed with exit code: $exitCode" -ForegroundColor Red
@@ -116,8 +122,8 @@ if (-not (Test-SalesforceCLI)) {
exit 1
}
# If ListOrgs is specified, show all authenticated orgs and exit
if ($ListOrgs) {
# If list is specified, show all authenticated orgs and exit
if ($list) {
Write-SectionHeader "Authenticated Orgs"
$success = Invoke-SafeSfCommand @("org", "list")
@@ -132,14 +138,14 @@ if ($ListOrgs) {
$sfArgs = @("org", "display")
# Add target org if specified
if ($o) {
if ($to) {
$sfArgs += "--target-org"
$sfArgs += $o
Write-Host "Target org: $o" -ForegroundColor Cyan
$sfArgs += $to
Write-Host "Target org: $to" -ForegroundColor Cyan
}
# Add verbose flag if requested
if ($Verbose) {
if ($ve) {
$sfArgs += "--verbose"
}
@@ -152,15 +158,15 @@ if (-not $success) {
}
# If limits are requested, show org limits
if ($Limits) {
if ($limits) {
Write-SectionHeader "Organization Limits"
# Build limits command
$limitsArgs = @("org", "list", "limits")
if ($o) {
if ($to) {
$limitsArgs += "--target-org"
$limitsArgs += $o
$limitsArgs += $to
}
$success = Invoke-SafeSfCommand $limitsArgs
@@ -171,7 +177,7 @@ if ($Limits) {
}
# Show additional org context if verbose
if ($Verbose) {
if ($ve) {
Write-SectionHeader "Additional Context"
# Show all authenticated orgs for context
@@ -186,9 +192,9 @@ if ($Verbose) {
Write-Host "👤 Current User Info:" -ForegroundColor Yellow
$userArgs = @("org", "display", "user")
if ($o) {
if ($to) {
$userArgs += "--target-org"
$userArgs += $o
$userArgs += $to
}
$success = Invoke-SafeSfCommand $userArgs
@@ -198,7 +204,7 @@ if ($Verbose) {
Write-Host ""
Write-Host "✅ Organization information retrieved successfully!" -ForegroundColor Green
if (-not $Limits -and -not $Verbose) {
if (-not $limits -and -not $ve) {
Write-Host ""
Write-Host "💡 Tip: Use -Limits to see org limits, -Verbose for more details, or -ListOrgs to see all authenticated orgs" -ForegroundColor Yellow
Write-Host "💡 Tip: Use -limits to see org limits, -ve for more details, or -list to see all authenticated orgs" -ForegroundColor Yellow
}