News for hackers. Stuff that matters.
Re:Turns out GCC has imperative argument handling by yjftsjthsd-h on Friday July 01, 2022 @05:43PM (#31953399)
> I thought find was a strong contender for Unix command with the weirdest argument handling, but I guess gcc takes the cake.

Depending on how you count, surely dd should take the cake? Otherwise, you're just including the group of commands that uses arguments as a command language, and I don't think that's actually such a small group; ffmpeg does the same thing, too.

Re:Turns out GCC has imperative argument handling by taviso on Friday July 01, 2022 @08:00PM (#31954610)
You mean because it uses foo=bar rather than --foo=bar? I don't know, it's not that weird.

I mean, find uses parentheses for forcing evaluation precedence, e.g. -foo -or \( -bar -and -baz \). That's pretty unusual.

Re:Turns out GCC has imperative argument handling by viraptor on Friday July 01, 2022 @10:26PM (#31955503)
And here's uwsgi https://uwsgi-docs.readthedocs.io/en/latest/Options.html with probably hundreds of options by now. It includes conditionals and basically its own scripting language right in the parameters.
Re:Turns out GCC has imperative argument handling by grumbel on Saturday July 02, 2022 @04:38AM (#31957303)
Most frustrating part with find is:

     $ find -type f  .
     find: paths must precede expression: `.'
It's like the tool knows exactly what you want to do, but still refuses to do it just because.
Re:Turns out GCC has imperative argument handling by tux1968 on Saturday July 02, 2022 @07:34AM (#31958165)
In the same vein:

   $ git grep Congrats -i
   fatal: option '-i' must come before non-option arguments
Frustrating.
Re:Turns out GCC has imperative argument handling by xg15 on Saturday July 02, 2022 @07:45AM (#31958219)
Apropos that (though a bit OT) : what exactly is the deal with unescaped parantheses in bash?

They just seem to produce a syntax error no matter where I use them. But if they have no purpose, then why not simply treat them as nonspecial characters?

E.g.

  echo hello :-) ;
is invalid syntax, even though it doesn't seem to cause any ambiguities with any other bash syntax features. Why not just allow this and treat it like

  echo "hello" ":-)";

?
Re:Turns out GCC has imperative argument handling by xioxox on Saturday July 02, 2022 @04:38AM (#31957309)
ps can also get a prize with its incompatible mixture of BSD (non-hyphenated) and UNIX (hyphenated) options. The letters chosen appear pretty random, too.
Re:Turns out GCC has imperative argument handling by wongarsu on Friday July 01, 2022 @08:04PM (#31954630)
since dd was there first (predating "modern" argument conventions) surely it's every other software that's weird /s
Re:Turns out GCC has imperative argument handling by kragen on Friday July 01, 2022 @08:34PM (#31954821)
As I heard the story, dd's arguments are making fun of IBM OS/360 JCL.