Skip to content

Feedback message for invalid screen dimensions missing .format() #40

@FelixHenninger

Description

@FelixHenninger

Hi @adswa, hi everyone,

I noticed a super-tiny (and really non-)issue while testing your package: The error message for an invalid screen size could use a format() to populate the placeholder in the error text (e.g. you could add .format(' '.join([str(v) for v in args.screensize])).

I would have opened a pull request (and would still be happy to do that), but after writing the code I wondered if it would make sense instead to move the validation into the argparse section, by specifying nargs=2 and maybe type=int for the screen size argument (or float, which would also do the conversion?). I think that might simplify the code, but I didn't want to just remove your validation step without checking first.
(one more thing I tried: The argparse documentation suggests that it should be possible to write metavar=('<screenX>', '<screenY>') to make the help message clearer, but apparently there's a bug with that, or at least I couldn't get it to work -- maybe you have an idea?).

Do you have a preference for an approach? (if you think this is even worth addressing) If you do, please let me know, I'd be happy to make a PR; but please feel free to make the change directly if you feel like it, though -- I wouldn't want to make a fuss out of this tiny thing.

Kind regards, and keep up the awesome work!

-Felix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions