commanderx16 / x16-emulator

Emulator for the Commander X16 8-bit computer
383 stars 60 forks source link

Standard in Linux that long options have --, i.e. two hyphens #37

Open mobluse opened 5 years ago

mobluse commented 5 years ago

In GNU/Linux it is standard for new commands that long options start with -- (two hyphens) and short options with - (one hyphen). I thinks this standard should be followed for x16emu and other future commands in this system. You could also have short options e.g. -r, -c, -s, -p, -r, -b, -e, -l, -d, -a for --rom, --char, --sdcard, --prg, --run, --bas, --echo, --log, --debug, --scale, respectively.

https://askubuntu.com/questions/813303/whats-the-difference-between-one-hyphen-and-two-hyphens-in-a-command/813432

indigodarkwolf commented 5 years ago

There's actually a full POSIX and GNU standard if we really want... https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html

mist64 commented 5 years ago

I'm not convinced this is a good this for this project.

First of all, yes, UNIX tools tend to have this syntax. But it's not a universal standard for programs that can be started from the command line. x16emu is cross-platform and runs on Windows, too, and there is no reason it wouldn't run on AmigaOS. There are many programs that take options in this format – VICE would be one (quite related) example.

Apart from compliance to one specific standard, I don't really see an advantage in having short options. It's not like "ls" or "grep", where you want to type the options quickly. If I look at a command line using -r, -c, -s, -p, -r, -b, -e, -l, -d, -a, I don't immediately see what the options mean. I see the X16 as a teaching system, and teaching newbies what they are actually doing when someone pastes them a command line to start x16emu differently is something I find important.

polluks commented 5 years ago

Apropos AmigaOS, I have done a MorphOS port http://aminet.net/package/misc/emu/x16-emulator

Kroc commented 5 years ago

I have to disagree in that more and more Windows command line tools are adopting the Linux style simply because of more tools being cross-platform now and it is to the user's future benefit that they learn that double-dash is the standard for option long-names. If X16emu is the exception, that doesn't help anybody -- new user or old!

mobluse commented 5 years ago

Fuse is a ZX Spectrum emulator that has GNU/Linux options with autocompletion:

$ fuse --help

The Free Unix Spectrum Emulator (Fuse) version 1.5.7.

Available command-line options:

Boolean options (use `--no-<option>' to turn off):

--auto-load            Automatically load tape files when opened.
--compress-rzx         Write RZX files out compressed.
--issue2               Emulate an Issue 2 Spectrum.
--kempston             Emulate the Kempston joystick on QAOP<space>.
--loading-sound        Emulate the sound of tapes loading.
--sound                Produce sound.
--sound-force-8bit     Generate 8-bit sound even if 16-bit is available.
--slt                  Turn SLT traps on.
--traps                Turn tape traps on.

Other options:

--help                 This information.
--machine <type>       Which machine should be emulated?
--playback <filename>  Play back RZX file <filename>.
--record <filename>    Record to RZX file <filename>.
--separation <type>    Use ACB/ABC stereo for the AY-3-8912 sound chip.
--snapshot <filename>  Load snapshot <filename>.
--speed <percentage>   How fast should emulation run?
--fb-mode <mode>       Which mode should be used for FB?
--tape <filename>      Open tape file <filename>.
--version              Print version number and exit.

For help, please mail <fuse-emulator-devel@lists.sf.net> or use
the forums at <http://sourceforge.net/p/fuse-emulator/discussion/>.
For complete documentation, see the manual page of Fuse.
Serentty commented 5 years ago

This is far from a standard on Linux. There are quite a few programs which accept multi-letter arguments with only one hyphen. Personally, I would prefer leaving it the way that it is, since it's easier to type, and there aren't any single-letter arguments to be competing for syntax with anyway.

mobluse commented 4 years ago

Completion using tab works for long options if you use some library. So you don't have to type the long options ─ only the first letters.

polluks commented 4 years ago

@mobluse Which shell, fish?

FlightControl-User commented 1 year ago

Is this actual?