Skip to content

Commit

Permalink
fix: allow all mixed-case values for --sobject
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Jan 4, 2023
1 parent 1949b27 commit bf3dd11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions messages/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ You can list the standard objects, custom objects, or all. The lists include onl

Category of objects to list.

# invalid-sobject-type

"--sobject" flag can be set only to <all|custom|standard>."

# noTypeFound

No %s objects found.
10 changes: 8 additions & 2 deletions src/commands/sobject/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ export class SObjectList extends SfCommand<SObjectListResult> {
'target-org': requiredOrgFlagWithDeprecations,
'api-version': orgApiVersionFlagWithDeprecations,
loglevel,
sobject: Flags.enum({
sobject: Flags.string({
char: 's',
options: ['all', 'standard', 'custom', 'ALL', 'STANDARD', 'CUSTOM'],
default: 'ALL',
summary: messages.getMessage('flags.sobject.summary'),
aliases: ['sobjecttypecategory', 'c'],
parse: (val) => {
const lowercasedType = val.toLowerCase();
if (!['all', 'standard', 'custom'].includes(lowercasedType)) {
throw messages.createError('invalid-sobject-type');
}
return Promise.resolve(lowercasedType);
},
}),
};

Expand Down

0 comments on commit bf3dd11

Please sign in to comment.