douwei1904
douwei1904
2015-06-23 04:12
浏览 89

交互式CLI软件包-复选框和选择

I am trying to learn more about making some cool CLI interfaces to provide the options for some local scripts. By digging into the source of the yeoman-generator I was able to come across inquirer for Node, which is how I learned that it was possible. (Example of what it looks like below)

Specifically I want to be able to do something like display a list of checkboxes and use some key to select multiple options and then continue.

Is anyone familiar with any packages/modules for other CLI languages that would allow me to do something similar? I like Node, but do not generally use it for scripting. Something in Python, Ruby or Go (I just started playing with Go) would be ideal

inquirer-checkbox

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dounouxi1020
    dounouxi1020 2015-06-23 04:40
    已采纳

    The package which has been around for many years is called Curses. The modern version package is actually called nCurses, but is still compatible with the original one. Here's a sample screenshot:

    enter image description here

    I haven't tried it with Unicode characters - it should work, and then you can use more fancy characters to mark checkbuttons and such.

    Curses is available for Python, Ruby and Go (and C and many other languages!).

    点赞 评论

相关推荐