We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
interact.ReadLine 是否新增必填选项
interact.SelectOne
SelectOne(title string, options interface{}, defOpt string, allowQuit ...bool)
既然默认值已经是string,那options的interface是否能够确认类型, 好像defOpt只能是字符串下标
string
options
interface
defOpt
这种可能想要的只是bool
bool
参考 promptui
The text was updated successfully, but these errors were encountered:
原来实现的比较简单。一直也没时间进一步优化改进 :)
有兴趣可以参与改进下
Sorry, something went wrong.
@inhere Command Cli时好像无法正确解析bool类型
这是参照 go flag 的逻辑处理的。 bool 值一般不会主动通过输入设置false,因为默认就是false。 要设置只能 -f=false。 go flag 底层没改的话应该也是这样的
-f=false
@inhere 也试过 go flag方式init -f=false vue-test
init -f=false vue-test
会提示错误
ERROR: option error - bad flag syntax: -=
👍 哦 看到调试信息,好像知道哪里错误了
inhere
No branches or pull requests
interact.ReadLine 是否新增必填选项
interact.SelectOne
既然默认值已经是
string
,那options
的interface
是否能够确认类型,好像
defOpt
只能是字符串下标这种可能想要的只是
bool
参考 promptui
The text was updated successfully, but these errors were encountered: