https://bugzilla.redhat.com/show_bug.cgi?id=2547889



--- Comment #14 from Sviatoslav Sydorenko <[email protected]> ---
(In reply to Jakub Jelen from comment #9)
> > LGTM, otherwise, I guess. Could you use the long argument names for `sed -i 
> > -e`, though?
> 
> Thank you! Done that, though not sure if it helps much with the readability.

This is sort of a tribal knowledge thing, but in general, using long flag names
allows lowering the cognitive burden for the reader (especially someone from a
different bubble) having to look up the meaning/use search/manpages. Here's an
example of this argument being made for scripts:
https://changelog.com/posts/use-long-flags-when-scripting.
In general, short flags are for interactive use. One can remember what they
mean having just looked them up, but other people would need to learn that
context, so designing scripts for the reviewers/readers is a nice gesture in
general. This is similar to using appropriate variable names in "adult"
programming languages to label data instead of "a", "b", "c". In many contexts,
using long arguments helps improve scripts not only in Bash but also in Python,
because `f'--flag={value}'` allows fighting formatters splitting strings in
inconvenient places. So it's more universal than just spec files and pure bash.

I've seen this being practiced in some of the ecosystem and this spec file, for
example:
https://src.fedoraproject.org/rpms/python-aiohttp/blob/rawhide/f/python-aiohttp.spec#_95.

I can say that before seeing it I never knew what `-e` stands for. It
definitely helps with readability in more ways than one.

-------

(In reply to Miro HronĨok from comment #10)
> If you like that, you may also use long options for %pyproject_buildrequires
> -x/--extras and %pyproject_save_files -l/--assert-license (not yet
> documented in the Python packaging guidelines).

Nice! Thanks for sharing, I may end up using these elsewhere..


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2547889

Report this comment as SPAM: 
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202547889%23c14

-- 
_______________________________________________
package-review mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to