alan-if / alan

ALAN IF compilers and interpreters
https://alanif.se
Other
19 stars 3 forks source link

Switches Consistency in Alan and ARun #6

Closed tajmone closed 5 years ago

tajmone commented 5 years ago

Currently (3.0beta6 build 2015) the Alan compiler and ARun use slightly different switches for the same options, which is rather inconsistent and confusing.

Examples:

option alan arun
version -version --version
help -help none
verbosity -verbose -v

I think that, for consistency sake with Alan compiler, ARun should also allow (and list among the switches) -help; and that -version should replace --version — it looks like the double hyphen here is to distinguish between short and long options, whereas in Alan the double hyphen indicates negation of an option, but all this is rather confusing for these two apps are like two twins for the end user.

Alternatively, since Alan also accepts --version, it might make more sense to list that in the help options list, so the proposed switches would be the same in both tools.

Personally, I would have found it to be more intuitive to have -V for "version" and -v for verbose, at least in ARun.

From the stand point of an Alan author who is not a programmer (and couldn't care less about POSIX standards), the difference in switches between the two might be an added burden, especially if he/she doesn't work often with CLI tools.

Also note the following in ARun:

>arun -help
Unrecognized switch, -h

and:

>arun --help
Unrecognized switch, --

it seems that unrecognized switches are being truncated to two chars in the error report. Again, seems to related to the long/short options distinction mentioned before, but the error report gets confusing to an end users not involved in technicalities.

thoni56 commented 5 years ago

I have made some changes in the handling of switches in order to unify them a bit. Primarily both alan and arun now accepts

-version
--version
-help

Making the switches handling more similar is probably more work than it's worth since arun uses a minimalistic hand-coded handling and normal users would probably not use any switches except possibly the ones mentioned above.