Fix README to use two-character options consistently throughout

MAJOR CLEANUP: Fixed all inconsistencies in README documentation

Fixed sections:
- sf-deploy: -o,-s,-d,-t → -to,-sr,-dr,-ts
- sf-dry-run: Updated to match sf-deploy options
- sf-web-open: -o,-p,-U → -to,-pt,-ur
- sf-check: -v,-h → -vb,-hp
- sf-logs-tail: -o → -to
- All example command lines in workflows section
- Automatic Environment Verification examples
- Common Workflows examples

The README now consistently uses two-character options throughout:
 Help sections show proper option syntax (-to, -sr, -dr, etc.)
 All examples use the new two-character scheme
 Error message examples updated
 Workflow examples updated
 No more confusing mix of old/new option styles

Documentation is now fully aligned with the updated wrapper scripts.
This commit is contained in:
reynold
2025-08-28 18:34:12 +08:00
parent c0b5e2c642
commit 11f3b5bd86

102
README.md
View File

@@ -264,7 +264,7 @@ Real-time debug logs tail with filtering, levels, and Apex-only mode.
Usage: Usage:
```bash ```bash
sf-logs-tail [-o ORG] [--user-id USER] [--level DEBUG] [--duration 60] [--filter PATTERN] [--apex-only] sf-logs-tail [-to ORG] [--user-id USER] [--level DEBUG] [--duration 60] [--filter PATTERN] [--apex-only]
``` ```
```powershell ```powershell
sf-logs-tail.ps1 -TargetOrg sandbox -Level DEBUG -Duration 60 -ApexOnly -Filter "MyClass" sf-logs-tail.ps1 -TargetOrg sandbox -Level DEBUG -Duration 60 -ApexOnly -Filter "MyClass"
@@ -276,29 +276,29 @@ Wrapper for `sf project deploy start` that simplifies deploying multiple source
**Usage:** **Usage:**
```bash ```bash
sf-deploy -o <ORG_ALIAS_OR_USERNAME> (-s "<src1>,<src2>[,...]" | -d <DIRECTORY>) [-t "<Test1>,<Test2>[,...]"] sf-deploy -to <ORG_ALIAS_OR_USERNAME> (-sr "<src1>,<src2>[,...]" | -dr <DIRECTORY>) [-ts "<Test1>,<Test2>[,...]"]
``` ```
**Options:** **Options:**
- `-o` - Org alias or username for --target-org - `-to, --target-org` - Org alias or username for --target-org
- `-s` - Comma-separated list of --source-dir paths - `-sr, --sources` - Comma-separated list of --source-dir paths
- `-d` - Single directory path to deploy (alternative to -s) - `-dr, --directory` - Single directory path to deploy (alternative to -sr)
- `-t` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests) - `-ts, --tests` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-h` - Show help - `-hp, --help` - Show help
**Examples:** **Examples:**
```bash ```bash
# Deploy multiple flexipages (specific files) # Deploy multiple flexipages (specific files)
sf-deploy -o DEMO-ORG \ sf-deploy -to DEMO-ORG \
-s "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Page_Backup_With_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" -sr "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Page_Backup_With_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml"
# Deploy entire directory # Deploy entire directory
sf-deploy -o DEMO-ORG -d "force-app/main/default/classes" sf-deploy -to DEMO-ORG -dr "force-app/main/default/classes"
# Deploy with specific tests # Deploy with specific tests
sf-deploy -o DEMO-ORG \ sf-deploy -to DEMO-ORG \
-s "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \ -sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \
-t "SelectorOpportunity_Test,SelectorOpportunity2_Test" -ts "SelectorOpportunity_Test,SelectorOpportunity2_Test"
``` ```
### sf-dry-run ### sf-dry-run
@@ -307,29 +307,29 @@ Wrapper for `sf project deploy start --dry-run` that validates deployments witho
**Usage:** **Usage:**
```bash ```bash
sf-dry-run -o <ORG_ALIAS_OR_USERNAME> (-s "<src1>,<src2>[,...]" | -d <DIRECTORY>) [-t "<Test1>,<Test2>[,...]"] sf-dry-run -to <ORG_ALIAS_OR_USERNAME> (-sr "<src1>,<src2>[,...]" | -dr <DIRECTORY>) [-ts "<Test1>,<Test2>[,...]"]
``` ```
**Options:** **Options:**
- `-o` - Org alias or username for --target-org - `-to, --target-org` - Org alias or username for --target-org
- `-s` - Comma-separated list of --source-dir paths - `-sr, --sources` - Comma-separated list of --source-dir paths
- `-d` - Single directory path to validate (alternative to -s) - `-dr, --directory` - Single directory path to validate (alternative to -sr)
- `-t` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests) - `-ts, --tests` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-h` - Show help - `-hp, --help` - Show help
**Examples:** **Examples:**
```bash ```bash
# Validate multiple flexipages (specific files) # Validate multiple flexipages (specific files)
sf-dry-run -o DEMO-ORG \ sf-dry-run -to DEMO-ORG \
-s "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml" -sr "force-app/main/default/flexipages/Sample_Page.flexipage-meta.xml,force-app/main/default/flexipages/Sample_SalesNavigator.flexipage-meta.xml,force-app/main/default/flexipages/Sample_Role_Record_Page.flexipage-meta.xml"
# Validate entire directory # Validate entire directory
sf-dry-run -o DEMO-ORG -d "force-app/main/default/classes" sf-dry-run -to DEMO-ORG -dr "force-app/main/default/classes"
# Validate with specific tests # Validate with specific tests
sf-dry-run -o DEMO-ORG \ sf-dry-run -to DEMO-ORG \
-s "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \ -sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \
-t "SelectorOpportunity_Test,SelectorOpportunity2_Test" -ts "SelectorOpportunity_Test,SelectorOpportunity2_Test"
``` ```
### sf-web-open ### sf-web-open
@@ -338,25 +338,25 @@ Wrapper for `sf org open` that provides quick access to Salesforce orgs with opt
**Usage:** **Usage:**
```bash ```bash
sf-web-open [-o <ORG_ALIAS_OR_USERNAME>] [-p <RELATIVE_PATH>] [-U] sf-web-open [-to <ORG_ALIAS_OR_USERNAME>] [-pt <RELATIVE_PATH>] [-ur]
``` ```
**Options:** **Options:**
- `-o` - Org alias or username to pass as --target-org - `-to, --target-org` - Org alias or username to pass as --target-org
- `-p` - Relative path to open inside the org (e.g., "/lightning/setup/SetupOneHome/home") - `-pt, --path` - Relative path to open inside the org (e.g., "/lightning/setup/SetupOneHome/home")
- `-U` - URL-only: print the URL instead of opening a browser (passes --url-only) - `-ur, --url-only` - URL-only: print the URL instead of opening a browser (passes --url-only)
- `-h` - Show help - `-hp, --help` - Show help
**Examples:** **Examples:**
```bash ```bash
# Open a specific org (default home) # Open a specific org (default home)
sf-web-open -o DEMO-ORG sf-web-open -to DEMO-ORG
# Open Setup Home of a target org # Open Setup Home of a target org
sf-web-open -o NUSHUB-DR2 -p "/lightning/setup/SetupOneHome/home" sf-web-open -to NUSHUB-DR2 -pt "/lightning/setup/SetupOneHome/home"
# Get just the URL for scripting # Get just the URL for scripting
sf-web-open -o NUSHUB-DR2 -U sf-web-open -to NUSHUB-DR2 -ur
# Open the current default org # Open the current default org
sf-web-open sf-web-open
@@ -368,12 +368,12 @@ Environment verification tool that checks if the Salesforce CLI is properly inst
**Usage:** **Usage:**
```bash ```bash
sf-check [-v] [-h] sf-check [-vb] [-hp]
``` ```
**Options:** **Options:**
- `-v` - Verbose output (show detailed information) - `-vb, --verbose` - Verbose output (show detailed information)
- `-h` - Show help - `-hp, --help` - Show help
**Examples:** **Examples:**
```bash ```bash
@@ -381,7 +381,7 @@ sf-check [-v] [-h]
sf-check sf-check
# Verbose output with detailed system information # Verbose output with detailed system information
sf-check -v sf-check -vb
``` ```
**What it checks:** **What it checks:**
@@ -397,14 +397,14 @@ All wrapper scripts (deploy, dry-run, web-open, org-create, org-info, retrieve,
### ✅ **When SF CLI is installed (normal operation):** ### ✅ **When SF CLI is installed (normal operation):**
```bash ```bash
$ sf-deploy -o DEMO-ORG -d "force-app/main/default/classes" $ sf-deploy -to DEMO-ORG -dr "force-app/main/default/classes"
>>> Running: sf project deploy start --source-dir force-app/main/default/classes --target-org DEMO-ORG >>> Running: sf project deploy start --source-dir force-app/main/default/classes --target-org DEMO-ORG
# [deployment proceeds immediately] # [deployment proceeds immediately]
``` ```
### ❌ **When SF CLI is missing:** ### ❌ **When SF CLI is missing:**
```bash ```bash
$ sf-deploy -o DEMO-ORG -d "force-app/main/default/classes" $ sf-deploy -to DEMO-ORG -dr "force-app/main/default/classes"
❌ Salesforce CLI (sf) not found! ❌ Salesforce CLI (sf) not found!
Running environment check to help you get started... Running environment check to help you get started...
@@ -466,36 +466,36 @@ sf-retrieve -tp "ApexClass" -to MyScratch
### Deployment with Validation ### Deployment with Validation
```bash ```bash
# 1. First, validate your deployment (specific file) # 1. First, validate your deployment (specific file)
sf-dry-run -o DEMO-ORG -s "force-app/main/default/classes/MyClass.cls" sf-dry-run -to DEMO-ORG -sr "force-app/main/default/classes/MyClass.cls"
# 2. If validation passes, deploy for real # 2. If validation passes, deploy for real
sf-deploy -o DEMO-ORG -s "force-app/main/default/classes/MyClass.cls" sf-deploy -to DEMO-ORG -sr "force-app/main/default/classes/MyClass.cls"
# 3. Open the org to verify changes # 3. Open the org to verify changes
sf-web-open -o DEMO-ORG sf-web-open -to DEMO-ORG
# Alternative: Deploy entire directory # Alternative: Deploy entire directory
sf-dry-run -o DEMO-ORG -d "force-app/main/default/classes" sf-dry-run -to DEMO-ORG -dr "force-app/main/default/classes"
sf-deploy -o DEMO-ORG -d "force-app/main/default/classes" sf-deploy -to DEMO-ORG -dr "force-app/main/default/classes"
``` ```
### Working with Multiple Files ### Working with Multiple Files
```bash ```bash
# Deploy multiple related components (specific files) # Deploy multiple related components (specific files)
sf-deploy -o DEMO-ORG \ sf-deploy -to DEMO-ORG \
-s "force-app/main/default/classes/MyController.cls,force-app/main/default/classes/MyControllerTest.cls,force-app/main/default/aura/MyComponent" -sr "force-app/main/default/classes/MyController.cls,force-app/main/default/classes/MyControllerTest.cls,force-app/main/default/aura/MyComponent"
# Deploy entire directories # Deploy entire directories
sf-deploy -o DEMO-ORG -d "force-app/main/default/aura" sf-deploy -to DEMO-ORG -dr "force-app/main/default/aura"
sf-deploy -o DEMO-ORG -d "force-app/main/default/lwc" sf-deploy -to DEMO-ORG -dr "force-app/main/default/lwc"
``` ```
### Testing Specific Classes ### Testing Specific Classes
```bash ```bash
# Deploy with specific test execution # Deploy with specific test execution
sf-deploy -o DEMO-ORG \ sf-deploy -to DEMO-ORG \
-s "force-app/main/default/classes/MyClass.cls" \ -sr "force-app/main/default/classes/MyClass.cls" \
-t "MyClassTest,RelatedClassTest" -ts "MyClassTest,RelatedClassTest"
``` ```
## Features ## Features