diff options
| author | Hilton Chain <hako@ultrarare.space> | 2025-02-24 13:01:07 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2025-08-21 19:08:18 +0800 |
| commit | a6598a9019acb2dbf74fb284c2bd3dc132c30bfd (patch) | |
| tree | c10e8b098dff78b62261aa438cf9903f4d94cc16 | |
| parent | 3372525a86fb76481814defa756e703e65853a22 (diff) | |
scripts: import: Correct behavior for ‘--insert’ option.
The info manual documents ‘--insert=FILE’, but it wasn't actually supported.
* guix/scripts/import.scm (show-help): Add missing ‘FILE’.
(guix-import): Accept ‘--insert=FILE’.
Change-Id: I540d5feae3fe49c00e9bd6f7a8649ffe0d6e006d
| -rw-r--r-- | guix/scripts/import.scm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 9db4919156..a91e0cf6a6 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -70,7 +70,7 @@ Run IMPORTER with ARGS.\n")) (display (G_ " -h, --help display this help and exit")) (display (G_ " - -i, --insert insert packages into file alphabetically")) + -i, --insert=FILE insert packages into FILE alphabetically")) (display (G_ " -V, --version display version information and exit")) (newline) @@ -107,7 +107,18 @@ PROC callback." (category packaging) (synopsis "import a package definition from an external repository") - (match args + (define (process-args args) + (match args + ;; Workaround to accpet ‘--insert=FILE’, for the consistency of + ;; command-line interface. + ((arg . rest) + (if (string-prefix? "--insert=" arg) + (append (string-split arg #\=) + rest) + args)) + (_ args))) + + (match (process-args args) (() (format (current-error-port) (G_ "guix import: missing importer name~%"))) |
