Text-Based User Interfaces in Go – Beef up your commandline tools
1–6 of 6 posts
Re: Text-Based User Interfaces in Go – Beef up your commandline tools
#2Re: Text-Based User Interfaces in Go – Beef up your commandline tools
#3Is the "package" as the unit of encapsulation a limitation that makes Go unsuitable to the large scale modeling of concepts in problem domains outside of the "computer"?
Re: Text-Based User Interfaces in Go – Beef up your commandline tools
#4Helpful article thanks. My concern with Go is that it particularly suited to problems in the space of computing, and computer and data science. Like C, suited to systems programming. What I am unconvinced about yet, is how suited it is to problems that require the modeling of concepts and their interactions, an area well suited to object domain models outside of that sweet spot. I'm aware that the alternative to an o…
Re: Text-Based User Interfaces in Go – Beef up your commandline tools
#5Helpful article thanks. My concern with Go is that it particularly suited to problems in the space of computing, and computer and data science. Like C, suited to systems programming. What I am unconvinced about yet, is how suited it is to problems that require the modeling of concepts and their interactions, an area well suited to object domain models outside of that sweet spot. I'm aware that the alternative to an o…
Re: Text-Based User Interfaces in Go – Beef up your commandline tools
#6I want to be able to insert temporary widgets that can then be removed, and I want to continue to treat the terminal as a long ream of text. For example, like this:
$ my-program --verbose
Hello! Enter a choice:
> 1. Intergalactic warfare
2. The Egyptian Book of the Dead
3. Meatballs
The user should be able to use the keyboard's arrow keys to select stuff. When selected, I want the remove the whole menu and continue from there: $ my-program --verbose
Thanks, you selected meatballs.
Grinding meat
* Heating [######---] 5%
* Mixing spices [##-------] 15% (5g/sec)
Packaging
Shipping
When that, which is a kind of multi-step progress bar, is done, I want to delete and continue. And so on.I also want to show prompts, with autocompletion ("dropdowns"), and other things you typically want to users to be able to do.
If anyone has seen Docker's CLI, they do something like this, by writing one line per layer and updating each line in parallel, but without taking over the screen. I assume they use some ANSI escape sequences to position the cursor, but I've never investigated.
I haven't found anything which packages the above functionality into a nice library, however.