git's –end-of-options Flag(nesbitt.io) |
git's –end-of-options Flag(nesbitt.io) |
Remembering app-specific one-offs is kind of the worst!
The first release of git was in 2005, and Torvalds' Linux was clearly UNIX-inspired, so it's not like this was due to considerations for some other OS like DOS/Windows.
Now we can all run important CLI programs like Zork without a 'command doesn't exist' to command ratio of 1:4
I wonder: would it not be better to tell users with those edge cases to fix their problems some other way? To take an example from the article: why does someone have a filename beginning with a dash? Maybe don't do that.
I also chafe whenever I run into artificial restrictions on things like characters in names of things, because there's no good reason for them besides the laziness of developers or the limitations and inertia of existing systems that might be used under the hood, like DNS for instance.
Don't see that we get rid of either command lines in text or von Neumann any time soon.
git cmd --options -- rev -- pathspec
would be the fully specified revspec and pathspec git cmd --option -- rev --
would be just the revspec, excluding accidental options, without a pathspec git cmd --option revspec -- pathspec
and the single "--" would work as it currently does.Argh, that's when I wished for object oriented shells. Powershell sure isn't perfect but objects encoding their own meaning really helps differentiate those cases (but it may not always help the user if types aren't clear to the reader)
It's like passing a struct to a function instead of a badly serialized representation of a value
I agree that rust and haskell are not your typical OO (or not OO at all in a traditional sense) I guess my poorly worded claim was less focused on the OO nature of psh than on the typization (which both of these also do) - if you knew what type $rev and $path are, it's easier to distinguish intent, whether objects or not.
By the way, something munched the article title. An endash is incorrect command-line usage. It’s supposed to be a double hyphen.
Some software substitutes a double hyphen -- with an en dash rather than em, and use the triple hyphen --- for the em dash. Perhaps Hacker News' title formatter is one of them.
There is no reason to transform it to an endash. I don't know any software that would do that. Checked with an LLM, too. That makes no sense at all!
Should check what it does with branch names starting with a dash.
Of course that wouldn't be a security vulnerability, but a user error. It asks user approvals to execute those things and has disclaimers to check results. Which of course every user does all the time... /s