Skip to content

undocumented behavior in scrot #272

Open
@guijan

Description

@guijan

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:

scrot/src/scrot.c

Lines 432 to 435 in 75664ef

if ((xcim = XFixesGetCursorImage(disp)) == NULL) {
warnx("Can't get the cursor from X");
goto end;
}

Here, scrot can't make sense of the user's wishes, but marches on anyway:

scrot/src/options.c

Lines 503 to 504 in 75664ef

for (; *argv; ++argv)
warnx("ignoring extraneous non-option argument: %s", *argv);

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:

scrot/src/scrot.c

Lines 624 to 627 in 75664ef

case 'm': /* t was already taken, so m as in mini */
if (filenameThumb)
streamStr(&ret, filenameThumb);
break;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions