3 ms·
Your comment is confusing due to missing line breaks :-) Try indenting the lines with two spaces. And I agree, I would prefer: program -c=blue
by goto11 6y ago
Your comment is confusing due to missing line breaks :-) Try indenting the lines with two spaces.
And I agree, I would prefer:
program -c=blue
- smusamashah 6y agoToo late for that. Was on mobile app. program -c # omitted program -cblue # provided program -c blue # omitted This doesn't make sense. How -c blue is omitted while it looks just like an argument for -c
- goto11 6y agoIf the argument to "-c" is optional, the parser doesn't know if "blue" is a an optional argument to "-c" or separate argument to "program". I think the takeaway is to avoid options with optional arguments. If the argument to -c was required, "-c blue" would be fine.
- hibbelig 6y agoUsing the equals sign for long options has become convention, but using the equals sign for short options is very unusual. I find "-c blue" the most intuitive of the possibilities. It does mean that you can't have an optional argument for short options.