diff mbox series

[bug#43159,PATCHES,v2] scripts: Use 'define-command' and have 'guix help' use that.

Message ID 87tuw9iw34.fsf_-_@gnu.org
State Accepted
Headers show
Series [bug#43159,PATCHES,v2] scripts: Use 'define-command' and have 'guix help' use that. | expand

Checks

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

Commit Message

Ludovic Courtès Sept. 7, 2020, 12:56 p.m. UTC
Hi all!

Here’s a v2 of the patches, where I tried to take your feedback into
account.  Changes:

  • Categories that appear in uses of ‘define-command’ are now validated
    at macro-expansion time.

  • (guix scripts) contains an alist of the known categories and
    ‘show-help’ traverses it.

  • Changed the label for development commands to “commands for
    development”, and changed “advanced” to “plumbing”.

  • Added a “packaging” category.

  • Fixed the typos you reported.

The end result is:

--8<---------------cut here---------------start------------->8---
Usage: guix COMMAND ARGS...
Run COMMAND with ARGS.

COMMAND must be one of the sub-commands listed below:

  main commands
    deploy        deploy operating systems on a set of machines
    describe      describe the channel revisions currently used
    gc            invoke the garbage collector
    install       install packages
    package       manage packages and profiles
    pull          pull the latest revision of Guix
    remove        remove installed packages
    search        search for packages
    show          show information about packages
    system        build and deploy full operating systems
    time-machine  run commands from a different revision
    upgrade       upgrade packages to their latest version
    weather       report on the availability of pre-built package binaries

  software development commands
    container    run code in containers created by 'guix environment -C'
    environment  spawn one-off software environments
    pack         create application bundles

  packaging commands
    build      build packages or derivations without installing them
    challenge  challenge substitute servers, comparing their binaries
    download   download a file to the store and print its hash
    edit       view and edit package definitions
    graph      view and query package dependency graphs
    hash       compute the cryptographic hash of a file
    import     import a package definition from an external repository
    lint       validate package definitions
    publish    publish build results over HTTP
    refresh    update existing package definitions
    size       profile the on-disk size of packages

  plumbing commands
    archive    manipulate, export, and import normalized archives (nars)
    copy       copy store items remotely over SSH
    git        operate on Git repositories
    offload    set up and operate build offloading
    processes  list currently running sessions
    repl       read-eval-print loop (REPL) for interactive programming

Report bugs to: bug-guix@gnu.org.
GNU Guix home page: <https://www.gnu.org/software/guix/>
General help using Guix and GNU software: <https://guix.gnu.org/help/>
--8<---------------cut here---------------end--------------->8---

Let me know what you think!

Thanks,
Ludo’.

Comments

Ludovic Courtès Sept. 10, 2020, 10:34 a.m. UTC | #1
Ludovic Courtès <ludo@gnu.org> skribis:

> Here’s a v2 of the patches, where I tried to take your feedback into
> account.  Changes:
>
>   • Categories that appear in uses of ‘define-command’ are now validated
>     at macro-expansion time.
>
>   • (guix scripts) contains an alist of the known categories and
>     ‘show-help’ traverses it.
>
>   • Changed the label for development commands to “commands for
>     development”, and changed “advanced” to “plumbing”.
>
>   • Added a “packaging” category.
>
>   • Fixed the typos you reported.

I pushed this v2 as 3794ce93be8216d8378df7b808ce7f53b1e05a53.

Let’s iterate from here if people have ideas about better categorization
or things like that.

Thanks,
Ludo’.
Ricardo Wurmus Sept. 10, 2020, 10:55 a.m. UTC | #2
I’m a bit late, but I’m very happy to see that “for developers” has
become “for development”!

Ludovic Courtès <ludo@gnu.org> writes:

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> Here’s a v2 of the patches, where I tried to take your feedback into
>> account.  Changes:
>>
>>   • Categories that appear in uses of ‘define-command’ are now validated
>>     at macro-expansion time.

Neat!

>>   • (guix scripts) contains an alist of the known categories and
>>     ‘show-help’ traverses it.

Knowing that guile-config exists for automatically generating help
screens, configuration files, command line options, and all that I
wonder if there’s anything here that could become part of guile-config
and move out of Guix.

I had been in that situation myself where I felt that guile-config may
not be a great fit for my help texts because of minor quibbles about the
format or the way things are presented by default.  In the end I decided
to use guile-config, because I prefer to have this handled by someone
else who keeps thinking about the problems relating to argument parsing,
configuration files, and help texts.

It may not be a great fit for Guix now, but I wonder if it could.  In
the long run I think it would be good for Guix to become a little less
special — no matter if that’s monad macros, records, argparsing, or
configuration files.

This is not a recommendation either way.  I just wonder if in the long
term we could benefit from moving all this to a separate package.

>>   • Changed the label for development commands to “commands for
>>     development”, and changed “advanced” to “plumbing”.
>>
>>   • Added a “packaging” category.
>>
>>   • Fixed the typos you reported.
>
> I pushed this v2 as 3794ce93be8216d8378df7b808ce7f53b1e05a53.

Excellent!  Thank you!
diff mbox series

Patch

From b3494f3cd670e0d1e5842b9b022c2606a520d34a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Tue, 1 Sep 2020 22:23:50 +0200
Subject: [PATCH 1/2] ui: '--help' output links to
 <https://guix.gnu.org/help/>.

* guix/ui.scm (show-bug-report-information): Link to
<https://guix.gnu.org/help/> instead of <https://www.gnu.org/gethelp/>.
The former is much more useful and includes links to GNU manuals.
---
 guix/ui.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index efc3f39186..981e133aaf 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -541,8 +541,9 @@  There is NO WARRANTY, to the extent permitted by law.
 Report bugs to: ~a.") %guix-bug-report-address)
   (format #t (G_ "
 ~a home page: <~a>") %guix-package-name %guix-home-page-url)
-  (display (G_ "
-General help using GNU software: <http://www.gnu.org/gethelp/>"))
+  (format #t (G_ "
+General help using Guix and GNU software: <~a>")
+           "https://guix.gnu.org/help/")
   (newline))
 
 (define (augmented-system-error-handler file)
-- 
2.28.0