unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Tropin <andrew@trop.in>
To: zimoun <zimon.toutoune@gmail.com>, 50296@debbugs.gnu.org
Subject: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'.
Date: Tue, 31 Aug 2021 15:12:26 +0300	[thread overview]
Message-ID: <87ilzlizit.fsf@trop.in> (raw)
In-Reply-To: <86pmttopfk.fsf@gmail.com>

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

On 2021-08-31 12:53, zimoun wrote:

> Hi,
>
> On Tue, 31 Aug 2021 at 12:40, Andrew Tropin <andrew@trop.in> wrote:
>
>> +(define-command (guix-home . args)
>> +  (synopsis "build and deploy home environments")
>> +
>> +  (define (parse-sub-command arg result)
>> +    ;; Parse sub-command ARG and augment RESULT accordingly.
>> +    (if (assoc-ref result 'action)
>> +        (alist-cons 'argument arg result)
>> +        (let ((action (string->symbol arg)))
>> +          (case action
>> +            ((build
>> +              reconfigure
>> +              extension-graph shepherd-graph
>> +              list-generations describe
>> +              delete-generations roll-back
>> +              switch-generation search
>> +              import)
>> +             (alist-cons 'action action result))
>> +            (else (leave (G_ "~a: unknown action~%") action))))))
>
> For parsing the actions, I would define elsewhere the list.  Then if the
> action is unknown, you could use ’string-closest’ and so return an hint
> if there is a typo.
>
> Other said, this
>
>   guix home recnfigure
>
> would return
>
>   guix home: error: recnfigure: unknown action
>   hint: Did you mean `reconfigure'?
>
> WDYT?
>

Sounds good, the same "issue" exists for guix system subcommands, it
would be cool to have such functionality, but I would like to have those
changes to both guix system and guix home after wip-guix-home merged,
because backporting changes to rde is a little tedious.

Also, it seems related to subcommands/--arguments discussion and maybe
better to talk about it in a separate thread.

> 
> Cheers, simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2021-08-31 12:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  9:28 [bug#50296] [PATCH 0/2] Add 'guix home' command Andrew Tropin
     [not found] ` <handler.50296.B.16304022327647.ack@debbugs.gnu.org>
2021-08-31  9:40   ` [bug#50296] [PATCH 1/2] scripts: Add 'guix home' Andrew Tropin
2021-08-31 10:53     ` zimoun
2021-08-31 12:12       ` Andrew Tropin [this message]
2021-08-31 13:09         ` zimoun
2021-09-01  5:20           ` Andrew Tropin
2021-08-31  9:40   ` [bug#50296] [PATCH 2/2] scripts: home: Add import subcommand Andrew Tropin
2021-08-31 10:46 ` [bug#50296] [PATCH 0/2] Add 'guix home' command zimoun
2021-08-31 12:03   ` Andrew Tropin
2021-08-31 11:13 ` bug#50296: " Oleg Pykhalov
2021-08-31 11:46   ` [bug#50296] " Andrew Tropin
2021-08-31 12:47     ` Andrew Tropin
2021-08-31 14:23       ` Oleg Pykhalov
2021-09-01  5:36         ` Andrew Tropin
2021-09-09  6:10         ` Andrew Tropin
2021-09-09 17:45           ` Oleg Pykhalov
2021-09-10  5:31             ` Andrew Tropin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilzlizit.fsf@trop.in \
    --to=andrew@trop.in \
    --cc=50296@debbugs.gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).