resurrecting-open-source-projects / scrot

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

add informative error messages when parsing args #206

Closed guijan closed 1 year ago

guijan commented 1 year ago

This change also comes with some under the hood modifications to how args are handled.

This is a continuation of #200.

I've only gone as far as getting a build success, I haven't actually tested the changes. I'm leaving it a draft, I'm going to bed soon.

daltomi commented 1 year ago

~To fix: scrot --line width=a is preferable that it indicates that a it is not a number.~ Master branch:

scrot: the option is not a number: a

This branch:

scrot: option --line: suboption 'width': 'a' is too small
daltomi commented 1 year ago

Code style, name of functions: https://webkit.org/code-style-guidelines/#names

Lower-case the first letter, including all letters in an acronym, in a variable or function name.

guijan commented 1 year ago

Going to take the chance to force-push while nobody is looking. So the current situation is that this draft needs a reply and more testing from @daltomi who is a good tester, but it's pretty much complete.

daltomi commented 1 year ago

~Update Copyright: scrot.c and scrot_selection.c~

guijan commented 1 year ago

Can you suggest a name? I don't quite understand what the WebKit style wants here. Should it be "OptionsParsenum"?

daltomi commented 1 year ago

Can you suggest a name? I don't quite understand what the WebKit style wants here. Should it be "OptionsParsenum"?

Should be optionsParseNum()

Btw, you can use sed:

sed 's/options_parsenum/optionsParseNum/g' -i src/{*.c,*.h}
guijan commented 1 year ago

Changes made and commit squashed, thanks for the testing and suggestions and sorry for the delays.