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
varoption=newOption<JsonWebSignatureAlgorithmType>("-algorithm","The algorithm."){Arity=ArgumentArity.ExactlyOne,IsRequired=true};option.GetArgument().Completions.Clear();varnames=Enum.GetNames(typeof(JsonWebSignatureAlgorithmType)).Where(
n =>!n.Equals(nameof(JsonWebSignatureAlgorithmType.Unsupported),StringComparison.OrdinalIgnoreCase)&&!n.StartsWith("HS",StringComparison.OrdinalIgnoreCase)&&!n.StartsWith("PS",StringComparison.OrdinalIgnoreCase)).ToArray();option.AddCompletions(names);// same behavior with//option.FromAmong(names);
Now I call the executable with the --help argument.
Expected behavior:
The output looks like this - The filtered names:
-algorithm The algorithm.
<Es256|Es384|Es512|Hs256|Hs384|Hs512|Ps256|Ps384|Ps512|Rs256> (REQUIRED)
Actual behavior:
The output looks like this - The un-filtered names:
-algorithm The algorithm.
<Es256|Es384|Es512|Hs256|Hs384|Hs512|Ps256|Ps384|Ps512|Rs2
56|Rs384|Rs512|Unsupported> (REQUIRED)
Workaround:
As the Argument is a internal member I can only access It by doing dirty and unwanted reflection to clear the completions collection.
** Wishlist**
At least the FromAmong-call should clear the collections for validation and completion, or provide a boolean argument (force), which will do so (more explicit).
The text was updated successfully, but these errors were encountered:
I have an enum type:
And use that to create an option:
Now I call the executable with the
--help
argument.Expected behavior:
The output looks like this - The filtered names:
Actual behavior:
The output looks like this - The un-filtered names:
Workaround:
As the Argument is a internal member I can only access It by doing dirty and unwanted reflection to clear the completions collection.
** Wishlist**
At least the
FromAmong
-call should clear the collections for validation and completion, or provide a boolean argument (force), which will do so (more explicit).The text was updated successfully, but these errors were encountered: