Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

that's not the kind of option the article is talking about -- the long options are generally english words, and there is a limited set of them. Date uses two dashes for them -- like "--utc" and "--set". They won't work with +

Your example is a format string. date needed to tell if the positional argument is a format or a new date, and to make it easy, they decided to prefix the format with a special character. I am going to guess that this character should not be - (to avoid confusion with options), or numeric (to avoid confusion with new date), not have special meaning in common shells (to keep quoting simpler). They could have chosen : or ^ for example.



Nah. date could have used -f or any other letter to specify the format string. They did not _have_ to use +.


Completely agree, the implementer of date had many options. choosing + character, they apparently went for conciseness instead of convention.

Not sure what you are disagreeing with though, I made no claims that someone had to use +, or positional argument in general. Just an observation about what might have guided the design process.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: