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
Is your feature request related to a problem? Please describe.
If step 5 in my script requires a particular type of free-text input, (e.g. URL, S3 bucket, semver) if the user enters an invalid input, they'll have to start the form over (unless I implement a custom REPL for that input, or save WIP forms to disk)
Describe the solution you'd like
I'd like to be able to provide a regular expression to gum input, e.g.
# semver pattern, see https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
PATTERN='^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
gum input --regex $PATTERN
If the user enters an invalid input, there should be some kind of (accessible) feedback -- like flashing a warning symbol. Additionally, this might require a customizable warning message, e.g.:
This would definitely require some design work, and I'm not sure if there's a generic enough solution to warrant including this as a feature (instead of coming up with a nifty documentation snippet)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
If step 5 in my script requires a particular type of free-text input, (e.g. URL, S3 bucket, semver) if the user enters an invalid input, they'll have to start the form over (unless I implement a custom REPL for that input, or save WIP forms to disk)
Describe the solution you'd like
I'd like to be able to provide a regular expression to
gum input
, e.g.If the user enters an invalid input, there should be some kind of (accessible) feedback -- like flashing a warning symbol. Additionally, this might require a customizable warning message, e.g.:
Describe alternatives you've considered
Save intermediate inputs to disk and prompt users at start
implement REPL for the tricky
gum input
sAdditional context
This would definitely require some design work, and I'm not sure if there's a generic enough solution to warrant including this as a feature (instead of coming up with a nifty documentation snippet)
The text was updated successfully, but these errors were encountered: