command line options as `target: makefile` vs `target=makefile`


#1

It is traditional for programs that take command-line options in one of the following ways:

my-program optionname=option
my-program --optionname option
my-program --optionname=option
my-program /optionname option

R3-Alpha's %make-make.r had code for the first case, so you would say make-make OS_ID=1.2.3, or whatever. This was presumably just going with the flow of how options to GNU make were specified.

@giuliolunati had an interesting idea of using a more Rebol-like syntax:

my-program optionname: option

This not only is "more Rebolish", but you get filename completion on your options in most shells (because it's not trying to do the completion with optionname= glued to the front of it).

At the moment, you can use either --optionname= or optionname: with %make.r. I've been using the colon form for a while, and like it. For the sake of simplicity, I'm wondering if it should be the only option format that make.r supports.

I can't think of any technical reason not to do it. One could argue that it will look unfamiliar. But I think it's easier to read this way.

Is there any reason not to standardize to this?


#2

Given that "looking unfamiliar" and "being easier to read" are not exclusive alternatives, the only reason I can think of is to ease the labour of those for whom only the first is true. The way I see it, it is a shell command, so why not be nice and accept at least one kind of traditional shell syntax?

As long as it is not a stupendous technical burden to support both, of course.

Concerning file completion, everyone I know hacks it by putting a space in anyway and then deleting it after the completion completes :slight_smile: