<p>Yesterday I moved one of my software to spf13/cobra and apart from a few things I'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'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't want a rich interface after all. I'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'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'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'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's for asking a user for information, you can give it a list of options to choose from, etc </p>
<p>I don't recommend importing that library directly, instead fork it into your own repo, since I wouldn'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't need).</p></pre>Kraigius: <pre><p>Thank you very much. I'll have to evaluate the license as I think it'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's AGPLv3. That'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
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传