resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
495 stars 49 forks source link

undocumented behavior in scrot #272

Open guijan opened 1 year ago

guijan commented 1 year ago

scrot has some undocumented behavior and sometimes deliberately continues with some kludge when it fails to comply with the user's request.

We can see here that if the user requests that the cursor be included in the screenshot and scrot fails to capture the cursor, it will go ahead anyway without the the cursor: https://github.com/resurrecting-open-source-projects/scrot/blob/75664efd19d02c0d70006e902364a877bec902b9/src/scrot.c#L432-L435

Here, scrot can't make sense of the user's wishes, but marches on anyway: https://github.com/resurrecting-open-source-projects/scrot/blob/75664efd19d02c0d70006e902364a877bec902b9/src/options.c#L503-L504

In imPrintf(), if the user asks us to include the thumbnail's filename in the command to execute but there is no thumbnail, we just ignore it: https://github.com/resurrecting-open-source-projects/scrot/blob/75664efd19d02c0d70006e902364a877bec902b9/src/scrot.c#L624-L627

We used to have an entirely undocumented feature: #216.

There are more instances in the code. We should start hard erroring if we fail to do what we were told to do by the user, and we should get rid of undocumented behaviors or adopt and document them if they're sensible like #216.