clikt icon indicating copy to clipboard operation
clikt copied to clipboard

Support typo suggestions for `choice()` values

Open joffrey-bion opened this issue 5 months ago • 2 comments

If I have an enum of ~20 values, it's not very convenient to read the current error message:

> ./amper run -p andriod
Usage: amper run [<options>] -- [<app_arguments>]...

Error: invalid value for -p: invalid choice: andriod. (choose from js, jvm, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, watchosArm64, watchosArm32, watchosDeviceArm64, watchosSimulatorArm64, mingwX64, androidNativeArm32, androidNativeArm64, androidNativeX64, androidNativeX86)

It would be nice if the possibilities were filtered with the typo suggestor like it's done for options and arguments, and a nice Did you mean X? message appeared when there is only one.

joffrey-bion avatar May 16 '25 00:05 joffrey-bion