Quote:
Originally Posted by ShellShock
Is double hyphen a Unix convention?
|
It's a GNU convention (and it precedes bash), and
GNU's
Not
Unix, so it's not really Unix. But it's from the Unix-adjacent world.
Unix commands commonly had single-character flags: you might have "-h" for "help", "-l" for "list", -p for "print", and -e for "error". You can use multiple flags after a single dash, so "-lp" is the same as "-l -p".
GNU introduced long names—slower to type, but easier to remember. But when they did, there was a potential clash: is "-help" the same as "-h -e -l -p", or is it the single "help" option? To avoid this clash, they introduced the convention of using two dashes with a long option name. So "-help" remains "-h -e -l -p", while "--help" is the "help" long option.
This is why you get the original error message above: calibre says "error: no such option: -g" because it begins parsing "-generate-recently-added", sees a single dash, and interprets it as '-g -e -n -e -r -a....'.
http://www.catb.org/~esr/writings/ta...l/ch10s05.html has some discussion.