resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
512 stars 51 forks source link

`scrot -sf` stopped working #178

Closed umanwizard closed 2 years ago

umanwizard commented 2 years ago

since 95bea6b2fa309d3f6361ca5ebf122a57c8fa74cf , we can't use -s as a short option (e.g., instead of -sf, we now have to type -s -f, because otherwise f is interpreted as an argument to -s.).

This has broken some scripts of mine on upgrading to Ubuntu 22.04 pre-release.

I believe that it is against standard command-line flag conventions to have -s take an argument despite being a short option.

daltomi commented 2 years ago

The --select option now expects an optional argument.

Using the short option (-s) with the optional argument is valid, according to here: getopt(3) — Linux manual page Two colons mean an option takes an optional arg; if there is text in the current argv-element (i.e., in the same word as the option name itself, for example, "-oarg"), then it is returned in optarg, otherwise optarg is set to zero.

Ex: -o arg default argument -o default argument -oarg optional argument given

umanwizard commented 2 years ago

That is a fair point, but it's still the case that scripts that were previously broken (because e.g. they invoke scrot -sf) are now broken.

daltomi commented 2 years ago

I don't like breaking behaviors just for the sake of it, but I don't think that's dogma either :fire: The new features (hide/hold/blur) are tied to selection and the only way the user communicates with us is through arguments and the best place for this was for the --select option to determine the behavior. Anyway, I see that you already solved the problem easily.