5 ms·
If you wonder about command-line argument parsing with C and C++, getopt() is built-in: https://www.gnu.org/software/libc/manual/html_node/Getopt.html
by ho_schi 3y ago
If you wonder about command-line argument parsing with C and C++, getopt() is built-in:
https://www.gnu.org/software/libc/manual/html_node/Getopt.html
That said.
I think CLI programs are user friendly for professionals. Because they support input-process-output. Where input is STDOUT read by human, process is thinking by human and output is keyboard input to STDIN by human.
UIs for the general audience?
TUIs! TUIs are easily to parse, succinct in organization and fast input - all for humans. Humans can parse TUIs. And they can make up a mental modal.
GUIs fail often with a lack of organization, information overflow and distractions by weird metaphors.
The Windows 95 desktop metaphor is an example. It doesn’t make sense. Same for Windows 11 and its file-browser which makes it hard to recognize the filesystem or even just the home-directory. Now open Nautilus on Linux, it opens by default your home-directory (in most cases the place to be).
I like the CLI but TUIs are my love. GUIs are okay if are like a TUI.
- deleted 3y ago[deleted]
- unwind 3y agoThat is only true in some environments, since it's not in fact part of the language specification. See the manual page's [1] "STANDARDS" section, which reads: getopt() POSIX.1-2008. getopt_long() getopt_long_only() GNU. The use of '+' and '-' in optstring is a GNU extension. [1]: https://www.man7.org/linux/man-pages/man3/getopt.3.html https://www.man7.org/linux/man-pages/man3/getopt.3.html
- ho_schi 3y agoCorrect. It is probably a feature which isn’t necessary for the languages itself but Linux/POSIX.
- kergonath 3y ago> UIs for the general audience? TUIs! TUIs are easily to parse, succinct in organization and fast input - all for humans. Humans can parse TUIs. And they can make up a mental modal. TUIs have the same drawbacks as GUIs and then some. Their big advantage is to work seamlessly over SSH but that’s pretty much it. They are not more discoverable and they are not more efficient than GUIs. There is nothing preventing you from having a decent GUI along the same lines as Midnight Commander to have a file manager without the metaphors you dislike, for example (as a matter of fact, there are several).
- Linux-Fan 3y agoWorking over SSH is not the only TUI advantage: IMHO one of the greatest benefits of TUIs is the usage of characters to display the UI. This way, the font size is always equal (no unreadably small fonts). When designing TUIs I found this to be limiting in a creative sense -- I have to really think about how I arrange the TUI elements and information because I cannot put as many elements as I can on a GUI in the same screen space. Also, TUIs seem to be mostely unaffected by the trend to make every GUI element “touch-friendly” large which is an advantage for me as a Desktop user. Full rant here: <https://masysma.net/37/why_terminal.xhtml https://masysma.net/37/why_terminal.xhtml>
- IshKebab 3y agogetopt is not built in.
- indymike 3y ago> UIs for the general audience? TUIs! TUIs are ideal (sometimes) where a command needs to be interactive. Many commands lend themselves well to batch processing or require no interactivity at all. In many cases, a script piped into a text editor (which is a TUI) is all that is needed, sparing apps from having to embed a text editor and deal with all of the design choices. Other times GUI will work a lot better.