unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] guix: Clean up --help messages.
@ 2015-06-07  9:20 Alex Kost
  2015-06-07 15:37 ` Ludovic Courtès
  2015-06-07 19:26 ` Alex Kost
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Kost @ 2015-06-07  9:20 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

This is a boring message about some really minor things.

While working on "guix" shell completions, I noticed that "--help"
messages want some nitpicking.

I think that formatting of system actions should be adjusted to the
formatting of guix subcommands and importers (an aligned list of
commands).  What about a newline between a description line and
commands?  Should it be there (as in ‘guix --help’ now) or not (as in
‘guix import --help’)?

--8<---------------cut here---------------start------------->8---
Some description here:

   some
   commands
   here
--8<---------------cut here---------------end--------------->8---

The patch is attached, thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-Clean-up-help-messages.patch --]
[-- Type: text/x-patch, Size: 3080 bytes --]

From 2b561a47cf29480b5a4d686a3f3596569f0394f6 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Sun, 7 Jun 2015 11:46:06 +0300
Subject: [PATCH] guix: Clean up --help messages.

* guix/scripts/import.scm (show-help): Add newline before a list of
  importers.
* guix/scripts/lint.scm (show-help): Split a long description line.
* guix/scripts/system.scm (show-help): Format actions the same way as
  guix commands and importers are formatted.
---
 guix/scripts/import.scm |  1 +
 guix/scripts/lint.scm   |  3 ++-
 guix/scripts/system.scm | 13 +++++++------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 06b4c17..45ce092 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -86,6 +86,7 @@ rather than \\n."
 Run IMPORTER with ARGS.\n"))
   (newline)
   (display (_ "IMPORTER must be one of the importers listed below:\n"))
+  (newline)
   (format #t "~{   ~a~%~}" importers)
   (display (_ "
   -h, --help             display this help and exit"))
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 3b139ce..3740b71 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -575,7 +575,8 @@ descriptions maintained upstream."
 
 (define (show-help)
   (display (_ "Usage: guix lint [OPTION]... [PACKAGE]...
-Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n"))
+Run a set of checkers on the specified package; if none is specified,
+run the checkers on all packages.\n"))
   (display (_ "
   -c, --checkers=CHECKER1,CHECKER2...
                          only run the specificed checkers"))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index b6d7d0d..f7c9d83 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -368,18 +368,19 @@ boot directly to the kernel or to the bootloader."
 Build the operating system declared in FILE according to ACTION.\n"))
   (newline)
   (display (_ "The valid values for ACTION are:\n"))
+  (newline)
   (display (_ "\
-  - 'reconfigure', switch to a new operating system configuration\n"))
+   reconfigure      switch to a new operating system configuration\n"))
   (display (_ "\
-  - 'build', build the operating system without installing anything\n"))
+   build            build the operating system without installing anything\n"))
   (display (_ "\
-  - 'vm', build a virtual machine image that shares the host's store\n"))
+   vm               build a virtual machine image that shares the host's store\n"))
   (display (_ "\
-  - 'vm-image', build a freestanding virtual machine image\n"))
+   vm-image         build a freestanding virtual machine image\n"))
   (display (_ "\
-  - 'disk-image', build a disk image, suitable for a USB stick\n"))
+   disk-image       build a disk image, suitable for a USB stick\n"))
   (display (_ "\
-  - 'init', initialize a root file system to run GNU.\n"))
+   init             initialize a root file system to run GNU.\n"))
 
   (show-build-options-help)
   (display (_ "
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] guix: Clean up --help messages.
  2015-06-07  9:20 [PATCH] guix: Clean up --help messages Alex Kost
@ 2015-06-07 15:37 ` Ludovic Courtès
  2015-06-07 19:26 ` Alex Kost
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-06-07 15:37 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> From 2b561a47cf29480b5a4d686a3f3596569f0394f6 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Sun, 7 Jun 2015 11:46:06 +0300
> Subject: [PATCH] guix: Clean up --help messages.
>
> * guix/scripts/import.scm (show-help): Add newline before a list of
>   importers.
> * guix/scripts/lint.scm (show-help): Split a long description line.
> * guix/scripts/system.scm (show-help): Format actions the same way as
>   guix commands and importers are formatted.

Sure, go ahead!

Ludo'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] guix: Clean up --help messages.
  2015-06-07  9:20 [PATCH] guix: Clean up --help messages Alex Kost
  2015-06-07 15:37 ` Ludovic Courtès
@ 2015-06-07 19:26 ` Alex Kost
  2015-06-07 19:37   ` Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Kost @ 2015-06-07 19:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

Sorry, there is another thing I forgot.  Currently ‘guix package --help’
displays the following:

--8<---------------cut here---------------start------------->8---
Usage: guix package [OPTION]... PACKAGES...
Install, remove, or upgrade PACKAGES in a single transaction.

  -i, --install=PACKAGE  install PACKAGE
  -e, --install-from-expression=EXP
                         install the package EXP evaluates to
  -r, --remove=PACKAGE   remove PACKAGE
...
--8<---------------cut here---------------end--------------->8---

I think it is not clear that multiple packages may be installed/removed
by a single command.  If it would look like this:

  -i, --install=PACKAGE...  install PACKAGEs

it may not be clear how the PACKAGEs are separated, since it is a common
practice to use "," to separate things after an "=" sign.  So I suggest
to remove "=" from ‘--install’ and ‘--remove’ options:

  -i, --install PACKAGE ...  install PACKAGEs

In my opinion it is the most clear way for that.  WDYT?

The modified patch is attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-Clean-up-help-messages.patch --]
[-- Type: text/x-diff, Size: 4169 bytes --]

From 58cf074945b1c20e3badb86bf2ed222f89b2c879 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Sun, 7 Jun 2015 11:46:06 +0300
Subject: [PATCH] guix: Clean up --help messages.

* guix/scripts/import.scm (show-help): Add newline before a list of
  importers.
* guix/scripts/lint.scm (show-help): Split a long description line.
* guix/scripts/system.scm (show-help): Format actions the same way as
  guix commands and importers are formatted.
---
 guix/scripts/import.scm  |  1 +
 guix/scripts/lint.scm    |  3 ++-
 guix/scripts/package.scm | 10 ++++++----
 guix/scripts/system.scm  | 13 +++++++------
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 06b4c17..45ce092 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -86,6 +86,7 @@ rather than \\n."
 Run IMPORTER with ARGS.\n"))
   (newline)
   (display (_ "IMPORTER must be one of the importers listed below:\n"))
+  (newline)
   (format #t "~{   ~a~%~}" importers)
   (display (_ "
   -h, --help             display this help and exit"))
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 3b139ce..3740b71 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -575,7 +575,8 @@ descriptions maintained upstream."
 
 (define (show-help)
   (display (_ "Usage: guix lint [OPTION]... [PACKAGE]...
-Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n"))
+Run a set of checkers on the specified package; if none is specified,
+run the checkers on all packages.\n"))
   (display (_ "
   -c, --checkers=CHECKER1,CHECKER2...
                          only run the specificed checkers"))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 4ae5114..d9f38fb 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -422,15 +422,17 @@ ENTRIES, a list of manifest entries, in the context of PROFILE."
     (substitutes? . #t)))
 
 (define (show-help)
-  (display (_ "Usage: guix package [OPTION]... PACKAGES...
-Install, remove, or upgrade PACKAGES in a single transaction.\n"))
+  (display (_ "Usage: guix package [OPTION]...
+Install, remove, or upgrade packages in a single transaction.\n"))
   (display (_ "
-  -i, --install=PACKAGE  install PACKAGE"))
+  -i, --install PACKAGE ...
+                         install PACKAGEs"))
   (display (_ "
   -e, --install-from-expression=EXP
                          install the package EXP evaluates to"))
   (display (_ "
-  -r, --remove=PACKAGE   remove PACKAGE"))
+  -r, --remove PACKAGE ...
+                         remove PACKAGEs"))
   (display (_ "
   -u, --upgrade[=REGEXP] upgrade all the installed packages matching REGEXP"))
   (display (_ "
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index b6d7d0d..f7c9d83 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -368,18 +368,19 @@ boot directly to the kernel or to the bootloader."
 Build the operating system declared in FILE according to ACTION.\n"))
   (newline)
   (display (_ "The valid values for ACTION are:\n"))
+  (newline)
   (display (_ "\
-  - 'reconfigure', switch to a new operating system configuration\n"))
+   reconfigure      switch to a new operating system configuration\n"))
   (display (_ "\
-  - 'build', build the operating system without installing anything\n"))
+   build            build the operating system without installing anything\n"))
   (display (_ "\
-  - 'vm', build a virtual machine image that shares the host's store\n"))
+   vm               build a virtual machine image that shares the host's store\n"))
   (display (_ "\
-  - 'vm-image', build a freestanding virtual machine image\n"))
+   vm-image         build a freestanding virtual machine image\n"))
   (display (_ "\
-  - 'disk-image', build a disk image, suitable for a USB stick\n"))
+   disk-image       build a disk image, suitable for a USB stick\n"))
   (display (_ "\
-  - 'init', initialize a root file system to run GNU.\n"))
+   init             initialize a root file system to run GNU.\n"))
 
   (show-build-options-help)
   (display (_ "
-- 
2.4.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] guix: Clean up --help messages.
  2015-06-07 19:26 ` Alex Kost
@ 2015-06-07 19:37   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-06-07 19:37 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> I think it is not clear that multiple packages may be installed/removed
> by a single command.  If it would look like this:
>
>   -i, --install=PACKAGE...  install PACKAGEs
>
> it may not be clear how the PACKAGEs are separated, since it is a common
> practice to use "," to separate things after an "=" sign.  So I suggest
> to remove "=" from ‘--install’ and ‘--remove’ options:
>
>   -i, --install PACKAGE ...  install PACKAGEs

Right, sounds good.

> From 58cf074945b1c20e3badb86bf2ed222f89b2c879 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Sun, 7 Jun 2015 11:46:06 +0300
> Subject: [PATCH] guix: Clean up --help messages.
>
> * guix/scripts/import.scm (show-help): Add newline before a list of
>   importers.
> * guix/scripts/lint.scm (show-help): Split a long description line.
> * guix/scripts/system.scm (show-help): Format actions the same way as
>   guix commands and importers are formatted.

OK!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-07 19:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-07  9:20 [PATCH] guix: Clean up --help messages Alex Kost
2015-06-07 15:37 ` Ludovic Courtès
2015-06-07 19:26 ` Alex Kost
2015-06-07 19:37   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).