You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you can see lalaFlag respects required:true: (property) lala: OptionFlag<string, CustomOptions>
and testFlag doesn't: (property) test: OptionFlag<string | undefined, CustomOptions>
Expected behavior
custom flag type should recognize when required is set.
Environment (please complete the following information):
You can see that required is actually passed (see below the help text org --target-org after required: true is deleted in org api), the issue seems to be only the flag type:
The text was updated successfully, but these errors were encountered:
Describe the bug
If I have a custom flag with
required: true
and use it in a command, its type is<T | undefined>
.To Reproduce
target-org
type is(property) 'target-org': OptionFlag<Org, CustomOptions>
org api commandtarget-org
type now is:(property) 'target-org': OptionFlag<Org | undefined, CustomOptions>
requiredOrgFlag
already setsrequired: true
so we shouldn't need to setrequired
again:https://github.com/salesforcecli/sf-plugins-core/blob/c43456953f5fb14bb64d1cc72f84c78c2c211088/src/flags/orgFlags.ts#L154
For comparision, I added a two flags in the
org api
command:https://github.com/cristiand391/sf-plugin-api/blob/deb78ab0eccd81ba9043760d7d4fe9d36bb2b474/src/commands/org/api.ts#L16-L23
lalaFlag
is a string flag,testFlag
is a custom flag and both setrequired: true
, if you check their types here:https://github.com/cristiand391/sf-plugin-api/blob/deb78ab0eccd81ba9043760d7d4fe9d36bb2b474/src/commands/org/api.ts#L31-L32
you can see
lalaFlag
respectsrequired:true
:(property) lala: OptionFlag<string, CustomOptions>
and
testFlag
doesn't:(property) test: OptionFlag<string | undefined, CustomOptions>
Expected behavior
custom flag type should recognize when
required
is set.Environment (please complete the following information):
Additional context
We've been manually setting
required
in our plugins:https://github.com/search?q=org%3Asalesforcecli+%2FFlags%5C.requiredOrg%2F+%2Frequired%3A+true%2F&type=code
You can see that
required
is actually passed (see below the help text org--target-org
afterrequired: true
is deleted inorg api
), the issue seems to be only the flag type:The text was updated successfully, but these errors were encountered: