RubyTTY是一个Ruby用来开发命令行应用的Gems,示例代码:
shell = TTY::Shell.newshell.ask "What is your name?" do argument :required default 'Piotr' validate /\w+\s\w+/ valid ['Piotr', 'Piotrek'] modify :capitalizeend.read_string点击空白处退出提示
RubyTTY是一个Ruby用来开发命令行应用的Gems,示例代码:
shell = TTY::Shell.newshell.ask "What is your name?" do argument :required default 'Piotr' validate /\w+\s\w+/ valid ['Piotr', 'Piotrek'] modify :capitalizeend.read_string
评论