-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change display text of default values #774
Comments
A PR would be welcome @tugrulates! Adding a Additionally we could also add a class SecretType extends StringType {
public override defaultText(): string {
return "******";
}
} new Command()
.option("--token <token:secret>", "Token.", {
default: "ACTUAL_TOKEN",
}); |
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 17, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
tugrulates
added a commit
to tugrulates/deno-cliffy
that referenced
this issue
Dec 18, 2024
This PR adds the following two features related to changing default value display for options. 1. `defaultText` option for options It is either a string or a function that transforms the default value into string. When set, it changes the help text of the default, while the underlying default value is used for processing. 2. `"secret"` input type This is exactly the same as string type, except it hides its default values on help text. Testing: new and existing unittests, playing with the build Fixes: c4spar#774
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature request for custom default value display on help.
Currently, a default value is displayed as is on the help.
This allows a pattern where secrets are read from ENV or a cache, and passed to the parser as default values, and only the parser is concerned with validating the required config. In this setup, secrets are preferably not logged to stdout.
One interface would like the following.
Another option would be simpler.
Commander provides an ability to change the display value of default values.
I am happy to contribute if this would be a welcome addition.
The text was updated successfully, but these errors were encountered: