dragora-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dragora-members] Qi 2.0rc14


From: Michael Siegel
Subject: Re: [Dragora-members] Qi 2.0rc14
Date: Fri, 24 Jul 2020 22:42:09 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Am 24.07.20 um 20:51 schrieb Matias Fonzo:
> 
> Attached is Qi 2.0rc14, which removes the replacement for basename(1)
> and dirname(1)...

Thanks!

> Better to keep it simple, right?.  ;-)

That's what I thought. :)

Okay, next thing: I would suggest using a "here-document"[1] to
implement the `usage()' function. This will make the code much more
readable.

The only disadvantage of using that method is with indentation:

Either you decide to use tabs to indent code like in the rest of
the script and have them stripped from the heredoc when it is printed
out. If you do that, you will have to use spaces to indent the actual
content of `usage()'.

Or you don't use code indentation in that function and have the
heredoc's content interpreted as pre-formatted text. Then you can use
whatever indentation method you like for the content.

I always do it the second way because I don't use tabs for
indentation.[2] For Qi, however, doing it the first way is probably better.

As far as the content of `usage()' goes, I think the description of Qi
should be kept to a single line. That's pretty much what most GNU-ish
command-line tools do, in my experience. People who want to know more
should consult the manual page. I would keep the description as the
first thing in the output of `usage()', however.


Best
Michael

[1]
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_04
[2] Here's an example:
https://vcs.malbolge.net/msi/mote/-/blob/2485e8f67d53ea226d598cbcf4e9386f75fbbb57/mote#L1102



reply via email to

[Prev in Thread] Current Thread [Next in Thread]