I am implementing a python CLI with Click. I wait to add an optional string parameter --name but I want to its length. Is there a native way to do that with click? e.g. some option to pass to @option
You can do the validation yourself by checking the length and raising a length error for the end user to know, but otherwise, there is no built-in way for click to enforce that
发布评论
评论(1)
您可以通过检查长度并为最终用户提出长度错误来自己进行验证,但是否则,单击没有内置的方式来强制执行该方法
You can do the validation yourself by checking the length and raising a length error for the end user to know, but otherwise, there is no built-in way for click to enforce that