edit
edit copied to clipboard
On Linux `edit -?` creates a file named `-?`
Windows:
PS C:\Users\zcobol> edit -?
Error 0x8007007b: The filename, directory name, or volume label syntax is incorrect.
PS C:\Users\zcobol> edit -v
edit version 1.2.0
Linux:
zcobol@texas:~/bin$ ./edit -v
edit version 1.2.0
zcobol@texas:~/bin$ ./edit -?
Editor opens and file can be saved:
zcobol@texas:~/bin$ file ./'-?'
./-?: ASCII text
That is normal behaviour, except that some command only accept arguments starting with a dash after --. So nano does the same as edit, but, vi doesn't.
I think it's worth trying to detect and reject invalid arguments though.
As long as people are still able to edit the document called -? (or even -h for that matter), probably through edit -- -h (talking about Linux conventions here).