boredzo

Also @boredzo@mastodon.social.

Breaker of binaries. Sweary but friendly. See also @TheMatrixDotGIF and @boredzo-kitchen-diary.



NireBryce
@NireBryce

2023 needs to be the last year linux shells let you print 'try using "<command> -h" for more information' and instead everything going forward just, by default, prints -h

and only as a stopgap measure. all of -h should just be listed when I hit tab after a -. even if my completions dir is fucked up to hell and back.


ireneista
@ireneista

and also we should have this information encoded in the binary in a machine-readable way so the shell can get it out in structured form. but that may not be a 2023 thing


boredzo
@boredzo

Commando was a feature in Apple's Macintosh Programmer's Workshop for classic Mac OS. Normally, MPW worksheets were basically a merger of command line and text file; you could edit text freely, but if you pressed ⌘-Return (or Enter if you had an extended keyboard) at the end of a line, it'd run the line as a command line and insert its output beneath it.

If you added Option (so Option-Enter or ⌘-Option-Return), it'd instead run a different command called Commando, with your command as its argument. Commando would then present a dialog box where you could configure the arguments to the command graphically, and show you a preview of the final command line at the bottom for you to OK or cancel.

I'm not well-versed in how to add support for Commando to an MPW command but a major piece of it is creating 'cmdo' resources, presumably saved in the resource fork of the command's executable.

(Note that just building a successor to Commando wouldn't be enough; there would also need to be some substitute for 'cmdo' resources, including a convention for where neo-Commando should look for them, and ideally shell support for the option-enter trick.)


You must log in to comment.

in reply to @NireBryce's post:

in reply to @boredzo's post:

The Haskell optparse-applicative library adds a --bash-completion-script option to your executable, I’m sure it could also be coerced to add one that prints the whole structure of the argument. Tho it also supports dynamic completions that run arbitary IO actions.

this does seem like a good start. we would like for completions to not be, you know, procedural scripts tied to bash specifically, so there's some work to be done to make it portable in all the ways it ought to be. we don't think that work is particularly hard, just detail-heavy.

Pinned Tags