Is there any library for building a CLI app with rich menus?

polaris · · 451 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Yesterday I moved one of my software to spf13/cobra and apart from a few things I&#39;m satisfied with the result and the cobra library.</p> <p>However, for a different software I want to build rich menus where after a user inputted a command + flag, a menu with different options will appear. Is there any library that can help me do that?</p> <hr/>**评论:**<br/><br/>gargamelus: <pre><p>I&#39;m not entirely sure what you are looking for, but have you had a look at <a href="https://github.com/c-bata/go-prompt">go-prompt</a>? It is serously cool!</p></pre>Kraigius: <pre><p>I take it back. Maybe I don&#39;t want a rich interface after all. I&#39;d be happy with just menus with number/letter selections. </p> <p>go-prompt looks great but overkill for my case.</p></pre>c-bata: <pre><p>Hi! I&#39;m an author of go-prompt. Thank you for your consideration.</p> <p>How about <a href="https://github.com/AlecAivazis/survey" rel="nofollow">survey</a>? I&#39;ve never used this, but looks interesting.</p></pre>Killing_Spark: <pre><p>Ncurses maybe? </p></pre>natefinch: <pre><p>This is a library I wrote for my last job. It does exactly what you&#39;re asking for below: <a href="https://godoc.org/github.com/juju/juju/cmd/juju/interact" rel="nofollow">https://godoc.org/github.com/juju/juju/cmd/juju/interact</a></p> <p>Especially check out the Pollster type. It&#39;s for asking a user for information, you can give it a list of options to choose from, etc </p> <p>I don&#39;t recommend importing that library directly, instead fork it into your own repo, since I wouldn&#39;t trust it to stay stable (you may also want to remove the jsonschema query... it brings in a ton of code that you likely don&#39;t need).</p></pre>Kraigius: <pre><p>Thank you very much. I&#39;ll have to evaluate the license as I think it&#39;s a viral one and I might not be able to bring the code under my project but in either case I want to thank you.</p></pre>natefinch: <pre><p>Ah yes, sorry I forgot it&#39;s AGPLv3. That&#39;s unfortunate. </p></pre>Rhelza: <pre><p>Like this one (<a href="https://github.com/urfave/cli" rel="nofollow">urfave/cli</a>)?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

451 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传