Skip to content

Commit d92a37d

Browse files
authored
fix(metadata:rename): resolve -o flag collision hiding default org (#443) (#449)
* fix(metadata:rename): resolve -o flag collision hiding default org (#443) The modern requiredOrgFlagWithDeprecations claims -o for --target-org, but --oldfullname also used char 'o'. So 'sf metadata rename -t X -o A -n B' routed '-o A' to --target-org, producing 'No authorization information found for A' and making it look like the default org was no longer detected (it worked in 0.3.2 when the org flag was -u). Move --oldfullname to char 'd' so -o maps to --target-org. The org flag then auto-detects the configured default org when omitted, restoring the pre-1.0.0 behavior. Updated in-command examples and the README usage. Fixes #443 * docs: use 'sf' instead of 'sfdx' in all command examples The plugin targets the modern sf CLI, but every command's examples= still showed the deprecated sfdx executable. Swap '$ sfdx' -> '$ sf' across all 10 commands. Also fix the dxsource example that used the old -u flag (now -o/--target-org). Note: the runtime 'sfdx force:mdapi:*' shell calls in retrieve/* and service/* are intentionally left for a separate migration to 'sf project retrieve/convert' (behavior change, needs org testing).
1 parent c24df17 commit d92a37d

11 files changed

Lines changed: 25 additions & 25 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,16 @@ Rename a metadata component using the Metadata API.
228228

229229
```
230230
USAGE
231-
$ sf metadata:rename -t <type> -o <oldname> -n <newname> [-u <username>] [--json]
231+
$ sf metadata:rename -t <type> -d <oldname> -n <newname> [-o <username>] [--json]
232232
233233
OPTIONS
234-
-t, --metadatatype (required) Metadata type (e.g. CustomObject, CustomField)
235-
-o, --oldfullname (required) Current API name of the component
236-
-n, --newfullname (required) New API name for the component
237-
-u, --targetusername Username or alias for the target org
234+
-t, --metadatatype (required) Metadata type (e.g. CustomObject, CustomField)
235+
-d, --oldfullname (required) Current API name of the component
236+
-n, --newfullname (required) New API name for the component
237+
-o, --target-org Username or alias for the target org; defaults to the configured default org
238238
239239
EXAMPLES
240-
$ sf metadata:rename -t CustomObject -o MyObject__c -n RenamedObject__c
240+
$ sf metadata:rename -t CustomObject -d MyObject__c -n RenamedObject__c
241241
```
242242

243243
---

src/commands/deploy/apex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class ApexDeploy extends SfCommand<any> {
2222
public static description = messages.getMessage('apexDeploy');
2323

2424
public static examples = [
25-
'$ sfdx deploy:apex -p filepath'
25+
'$ sf deploy:apex -p filepath'
2626
];
2727

2828
public static readonly flags = {

src/commands/deploy/aura.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class AuraDeploy extends SfCommand<any> {
1515
public static description = messages.getMessage('auraDeploy');
1616

1717
public static examples = [
18-
'$ sfdx deploy:aura -p filepath'
18+
'$ sf deploy:aura -p filepath'
1919
];
2020

2121
public static readonly flags = {

src/commands/deploy/lwc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class LWCDeploy extends SfCommand<any> {
1818
public static description = messages.getMessage('lwcDeploy');
1919

2020
public static examples = [
21-
'$ sfdx deploy:lwc -p filepath'
21+
'$ sf deploy:lwc -p filepath'
2222
];
2323

2424
public static readonly flags = {

src/commands/deploy/staticresource.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export default class StaticResourceDeploy extends SfCommand<any> {
1515
public static description = messages.getMessage("staticresourceDeploy");
1616

1717
public static examples = [
18-
"$ sfdx deploy:staticresource -p <filepath>",
19-
"$ sfdx deploy:staticresource -p <filepath> --cachecontrol public",
20-
"$ sfdx deploy:staticresource -p <filepath> --cachecontrol public --resourcefolder <name of the folder where you have single page app>"
18+
"$ sf deploy:staticresource -p <filepath>",
19+
"$ sf deploy:staticresource -p <filepath> --cachecontrol public",
20+
"$ sf deploy:staticresource -p <filepath> --cachecontrol public --resourcefolder <name of the folder where you have single page app>"
2121
];
2222

2323
public static readonly flags = {

src/commands/deploy/trigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class TriggerDeploy extends SfCommand<any> {
2424
public static description = messages.getMessage('triggerDeploy');
2525

2626
public static examples = [
27-
'$ sfdx deploy:trigger -p filepath'
27+
'$ sf deploy:trigger -p filepath'
2828
];
2929

3030
public static readonly flags = {

src/commands/deploy/vf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class VfDeploy extends SfCommand<any> {
2424
public static description = messages.getMessage('vfDeploy');
2525

2626
public static examples = [
27-
'$ sfdx deploy:vf -p filepath'
27+
'$ sf deploy:vf -p filepath'
2828
];
2929

3030
public static readonly flags = {

src/commands/deploy/vfcomponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class ApexComponentDeploy extends SfCommand<any> {
2424
public static description = messages.getMessage('vfComponentDeploy');
2525

2626
public static examples = [
27-
'$ sfdx deploy:vfcomponent -p filepath'
27+
'$ sf deploy:vfcomponent -p filepath'
2828
];
2929

3030
public static readonly flags = {

src/commands/metadata/rename.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default class RenameMetadata extends SfCommand<any> {
1111
public static description = messages.getMessage('renamemetadata');
1212

1313
public static examples = [
14-
'$ sfdx metadata:rename -t <metadatatype> -n <newname> -o <oldname>',
15-
'$ sfdx metadata:rename -t CustomObject -n MyCustomObject1New__c -o MyCustomObject1__c'
14+
'$ sf metadata:rename -t <metadatatype> -n <newname> -d <oldname>',
15+
'$ sf metadata:rename -t CustomObject -n MyCustomObject1New__c -d MyCustomObject1__c'
1616
];
1717

1818
public static readonly flags = {
@@ -31,7 +31,7 @@ export default class RenameMetadata extends SfCommand<any> {
3131
description: 'new name of the metadata element'
3232
}),
3333
oldfullname: Flags.string({
34-
char: 'o',
34+
char: 'd',
3535
required: true,
3636
description:
3737
'old name of the metadata element'

src/commands/retrieve/dxsource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export default class DxSource extends SfCommand<any> {
2020
public static description = messages.getMessage('retrieveDxSource');
2121

2222
public static examples = [
23-
'$ sfdx retrieve:dxsource -n <package/changeset>',
24-
'$ sfdx retrieve:dxsource -n <package/changeset> -m "true"',
25-
'$ sfdx retrieve:dxsource -n <package/changeset> -p <[pathName]>',
26-
'$ sfdx retrieve:dxsource -u myOrg@example.com -n <package/changeset> -p <[pathName]>'
23+
'$ sf retrieve:dxsource -n <package/changeset>',
24+
'$ sf retrieve:dxsource -n <package/changeset> -m "true"',
25+
'$ sf retrieve:dxsource -n <package/changeset> -p <[pathName]>',
26+
'$ sf retrieve:dxsource -o myOrg@example.com -n <package/changeset> -p <[pathName]>'
2727
];
2828

2929
public static readonly flags = {

0 commit comments

Comments
 (0)