diff mbox series

[bug#41539,1/2] size: Document that positional arguments can be store items.

Message ID 20200526133830.4438-1-mail@ambrevar.xyz
State Accepted
Headers show
Series [bug#41539,1/2] size: Document that positional arguments can be store items. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Pierre Neidhardt May 26, 2020, 1:38 p.m. UTC
* guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
  alternative.
---
 guix/scripts/size.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ludovic Courtès May 28, 2020, 9:19 p.m. UTC | #1
Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
>   alternative.

[...]

> * doc/guix.texi (Invoking `guix size'): Add guix size example for store item.

[...]

> +@example
> +guix size $(guix system build config.scm)

Please use backquotes instead of $(…), which is Bash-specific.

Otherwise LGTM, thank you!

Ludo’.
Pierre Neidhardt May 29, 2020, 9:25 a.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>
>> * guix/scripts/size.scm (show-help): Mention STORE-ITEM positional argument
>>   alternative.
>
> [...]
>
>> * doc/guix.texi (Invoking `guix size'): Add guix size example for store item.
>
> [...]
>
>> +@example
>> +guix size $(guix system build config.scm)
>
> Please use backquotes instead of $(…), which is Bash-specific.

Actually, it's not, $(...) is POSIX (you can test with Dash).
Backquotes are deprecated and have the downside of not nesting.

> Otherwise LGTM, thank you!

OK to merge, then?
Simon Tournier May 29, 2020, 9:56 a.m. UTC | #3
Dear,

On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> >> +@example
> >> +guix size $(guix system build config.scm)
> >
> > Please use backquotes instead of $(…), which is Bash-specific.
>
> Actually, it's not, $(...) is POSIX (you can test with Dash).
> Backquotes are deprecated and have the downside of not nesting.

Yes, $(...) is POSIX, AFAIK.
And let quote what POSIX says: "Because of these inconsistent
behaviors, the backquoted variety of command substitution is not
recommended for new applications that nest command substitutions or
attempt to embed complex scripts."

https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03

(I do not know if it is the latest version of the document.)


Well, $(...) is already used in the manual.  For example, X11 fonts
section because of nested.  But elsewhere not, see e.g., invoking guix
archive or Nteworking Services or Invoking guix system sections.

https://guix.gnu.org/manual/devel/en/guix.html#X11-Fonts
https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-archive
https://guix.gnu.org/manual/devel/en/guix.html#Networking-Services
https://guix.gnu.org/manual/devel/en/guix.html#Invoking-guix-system

Therefore, only one should be used.  And $(...) is better.  So I would
be in favour to replace all the backquotes by $(...) in the manual.


All the best,
simon
Ludovic Courtès May 29, 2020, 10:09 a.m. UTC | #4
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Fri, 29 May 2020 at 11:26, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
>> >> +@example
>> >> +guix size $(guix system build config.scm)
>> >
>> > Please use backquotes instead of $(…), which is Bash-specific.
>>
>> Actually, it's not, $(...) is POSIX (you can test with Dash).
>> Backquotes are deprecated and have the downside of not nesting.
>
> Yes, $(...) is POSIX, AFAIK.
> And let quote what POSIX says: "Because of these inconsistent
> behaviors, the backquoted variety of command substitution is not
> recommended for new applications that nest command substitutions or
> attempt to embed complex scripts."
>
> https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03

I stand corrected!  That’s news to me, but definitely good news.
I’m all for using $(…) from now on.

Thank you!

Ludo’.
Pierre Neidhardt May 29, 2020, 4:56 p.m. UTC | #5
Merged with 776409c5069de949da328b769132fa009477668c.
diff mbox series

Patch

diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index 2446b84587..c42f4f7782 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -230,8 +230,8 @@  the name of a PNG file."
 ;;;
 
 (define (show-help)
-  (display (G_ "Usage: guix size [OPTION]... PACKAGE
-Report the size of PACKAGE and its dependencies.\n"))
+  (display (G_ "Usage: guix size [OPTION]... PACKAGE|STORE-ITEM
+Report the size of the PACKAGE or STORE-ITEM, with its dependencies.\n"))
   (display (G_ "
       --substitute-urls=URLS
                          fetch substitute from URLS if they are authorized"))