Making the best CLI programs - Programming On Unix
Users browsing this thread: 1 Guest(s)
|
|||
(13-10-2016, 08:53 AM)z3bra Wrote: (Ok, the idea of "wasting" awk is stupid, but really, that's close to what I feel!) That is also how I feel sometimes: "I can't really call awk for this. It would be an overkill". I also feel dumb to use scripts that are 80% awk. Why not a script fully in awk with a <code>#!/usr/bin/awk -f</code> shebang... I also like ip-style scripts: it has a top-level command (ip) that has subcommands (address, link...), that also have subcommands... It is very easy to implement it in shell script: https://raw.githubusercontent.com/josuah...bin/config I do a top-level config command, and in the same directory, config-* commands that can be called from the config command. Each config-* command has a first line with a comment with description for the command. Without argument, the config command lists the subcommands with these descriptions, with arguments, it selects the scripts (partial name allowed: 'config-git' == 'config g') and run it with the aditionnal arguments. So I can type: Code: $ config build install tmux |
|||