Live data from Hacker News

Apple. Apple Please

digipres.club

11–20 of 64 posts

Re: Apple. Apple Please

#11

The way they disambiguate between the two options feels like it would have been a ton of work to figure out and implement... and for what purpose? I don't understand the user story here. How hard is it to type the long version?

As a user, I don’t want to have to type the full option name every time I use it.

Your shell should be smart enough autocomplete it anyway.

Re: Apple. Apple Please

#12
It's a bit of a strange choice, but if you read the full documentation (man codesign) it's not too confusing actually:

    NAME
           codesign — Create and manipulate code signatures
    
    SYNOPSIS
           codesign -s identity [-i identifier] [-r requirements] [-fv] path ...
           codesign -v [-R requirement] [-v] [path|pid ...]
           codesign -d [-v] [path|pid ...]
           codesign -h [-v] [pid ...]
           codesign --validate-constraint path ...
The first argument to codesign has to be one of -s, -v, -d, -h, --validate-constraint and in reality it's closer to a subcommand (similar to how git as pull, push, merge etc). After that "-v" works as a regular option.

EDIT: I read the man page even further, and I was slightly wrong: It appears to be possible to pass regular options before the operation, but you're required to have one (and only) one operation.

Re: Apple. Apple Please

#13

The way they disambiguate between the two options feels like it would have been a ton of work to figure out and implement... and for what purpose? I don't understand the user story here. How hard is it to type the long version?

> a ton of work to figure out and implement

Not really?

  while ((opt = getopt(...)) >= 0) switch (opt) {
  ...
  case 'v':
      if (!action) { action = VERIFY; break; }
      verbose++; break;
  ...
  }
(A followup post clarifies that a -v before a different action flag does not retroactively turn into “verbose”; in any case that’s also not hard to do. To be clear, both possibilities suck, I just disagree they’re difficult to implement.)

Re: Apple. Apple Please

#16

The way they disambiguate between the two options feels like it would have been a ton of work to figure out and implement... and for what purpose? I don't understand the user story here. How hard is it to type the long version?

As a user, I don’t want to have to type the full option name every time I use it.

If you are typing instead of using tab auto complete or shell history then that’s on you.

Re: Apple. Apple Please

#17

The way they disambiguate between the two options feels like it would have been a ton of work to figure out and implement... and for what purpose? I don't understand the user story here. How hard is it to type the long version?

As a user, I don’t want to have to type the full option name every time I use it.

As a user I almost never use short flags because it’s super confusing and inscrutable. But I admit I’m probably in the minority on this!

Re: Apple. Apple Please

#18
post #12

It's a bit of a strange choice, but if you read the full documentation (man codesign) it's not too confusing actually: NAME codesign — Create and manipulate code signatures SYNOPSIS codesign -s identity [-i identifier] [-r requirements] [-fv] path ... codesign -v [-R requirement] [-v] [path|pid ...] codesign -d [-v] [path|pid ...] codesign -h [-v] [pid ...] codesign --validate-constraint path ... The first argument t…

No, it's very confusing, especially for people who are used to tools built with GNU getopt.

Re: Apple. Apple Please

#20

The way they disambiguate between the two options feels like it would have been a ton of work to figure out and implement... and for what purpose? I don't understand the user story here. How hard is it to type the long version?

Apple engineers know they are the best and don’t care what anyone else says
Post reply on HN