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:
```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
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:**
```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:**
- `-o` - Org alias or username for --target-org
- `-s` - Comma-separated list of --source-dir paths
- `-d` - Single directory path to deploy (alternative to -s)
- `-t` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-h` - Show help
- `-to, --target-org` - Org alias or username for --target-org
- `-sr, --sources` - Comma-separated list of --source-dir paths
- `-dr, --directory` - Single directory path to deploy (alternative to -sr)
- `-ts, --tests` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-hp, --help` - Show help
**Examples:**
```bash
# Deploy multiple flexipages (specific files)
sf-deploy -o 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"
sf-deploy -to DEMO-ORG \
-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
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
sf-deploy -o 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" \
-t "SelectorOpportunity_Test,SelectorOpportunity2_Test"
sf-deploy -to DEMO-ORG \
-sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \
-ts "SelectorOpportunity_Test,SelectorOpportunity2_Test"
```
### sf-dry-run
@@ -307,29 +307,29 @@ Wrapper for `sf project deploy start --dry-run` that validates deployments witho
**Usage:**
```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:**
- `-o` - Org alias or username for --target-org
- `-s` - Comma-separated list of --source-dir paths
- `-d` - Single directory path to validate (alternative to -s)
- `-t` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-h` - Show help
- `-to, --target-org` - Org alias or username for --target-org
- `-sr, --sources` - Comma-separated list of --source-dir paths
- `-dr, --directory` - Single directory path to validate (alternative to -sr)
- `-ts, --tests` - Comma-separated list of --tests (enables --test-level RunSpecifiedTests)
- `-hp, --help` - Show help
**Examples:**
```bash
# Validate multiple flexipages (specific files)
sf-dry-run -o 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"
sf-dry-run -to DEMO-ORG \
-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
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
sf-dry-run -o 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" \
-t "SelectorOpportunity_Test,SelectorOpportunity2_Test"
sf-dry-run -to DEMO-ORG \
-sr "force-app/main/default/flexipages/Demo_Page.flexipage-meta.xml,force-app/main/default/flexipages/Demo_Page_Backup_With_SalesNavigator.flexipage-meta.xml" \
-ts "SelectorOpportunity_Test,SelectorOpportunity2_Test"
```
### sf-web-open
@@ -338,25 +338,25 @@ Wrapper for `sf org open` that provides quick access to Salesforce orgs with opt
**Usage:**
```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:**
- `-o` - Org alias or username to pass as --target-org
- `-p` - 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)
- `-h` - Show help
- `-to, --target-org` - Org alias or username to pass as --target-org
- `-pt, --path` - Relative path to open inside the org (e.g., "/lightning/setup/SetupOneHome/home")
- `-ur, --url-only` - URL-only: print the URL instead of opening a browser (passes --url-only)
- `-hp, --help` - Show help
**Examples:**
```bash
# 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
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
sf-web-open -o NUSHUB-DR2 -U
sf-web-open -to NUSHUB-DR2 -ur
# Open the current default org
sf-web-open
@@ -368,12 +368,12 @@ Environment verification tool that checks if the Salesforce CLI is properly inst
**Usage:**
```bash
sf-check [-v] [-h]
sf-check [-vb] [-hp]
```
**Options:**
- `-v` - Verbose output (show detailed information)
- `-h` - Show help
- `-vb, --verbose` - Verbose output (show detailed information)
- `-hp, --help` - Show help
**Examples:**
```bash
@@ -381,7 +381,7 @@ sf-check [-v] [-h]
sf-check
# Verbose output with detailed system information
sf-check -v
sf-check -vb
```
**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):**
```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
# [deployment proceeds immediately]
```
### ❌ **When SF CLI is missing:**
```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!
Running environment check to help you get started...
@@ -466,36 +466,36 @@ sf-retrieve -tp "ApexClass" -to MyScratch
### Deployment with Validation
```bash
# 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
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
sf-web-open -o DEMO-ORG
sf-web-open -to DEMO-ORG
# Alternative: Deploy entire directory
sf-dry-run -o DEMO-ORG -d "force-app/main/default/classes"
sf-deploy -o DEMO-ORG -d "force-app/main/default/classes"
sf-dry-run -to DEMO-ORG -dr "force-app/main/default/classes"
sf-deploy -to DEMO-ORG -dr "force-app/main/default/classes"
```
### Working with Multiple Files
```bash
# Deploy multiple related components (specific files)
sf-deploy -o DEMO-ORG \
-s "force-app/main/default/classes/MyController.cls,force-app/main/default/classes/MyControllerTest.cls,force-app/main/default/aura/MyComponent"
sf-deploy -to DEMO-ORG \
-sr "force-app/main/default/classes/MyController.cls,force-app/main/default/classes/MyControllerTest.cls,force-app/main/default/aura/MyComponent"
# Deploy entire directories
sf-deploy -o DEMO-ORG -d "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/aura"
sf-deploy -to DEMO-ORG -dr "force-app/main/default/lwc"
```
### Testing Specific Classes
```bash
# Deploy with specific test execution
sf-deploy -o DEMO-ORG \
-s "force-app/main/default/classes/MyClass.cls" \
-t "MyClassTest,RelatedClassTest"
sf-deploy -to DEMO-ORG \
-sr "force-app/main/default/classes/MyClass.cls" \
-ts "MyClassTest,RelatedClassTest"
```
## Features