guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: pack: List the available formats.


From: guix-commits
Subject: 01/01: pack: List the available formats.
Date: Tue, 27 Nov 2018 12:24:46 -0500 (EST)

efraim pushed a commit to branch master
in repository guix.

commit db08ea40873ae20507bc40d34a56dea1b8ce8f0e
Author: Efraim Flashner <address@hidden>
Date:   Tue Nov 6 11:50:48 2018 +0200

    pack: List the available formats.
    
    * guix/scripts/pack.scm (show-formats): New variable.
    (%options, show-help): Add 'list-formats' option.
---
 guix/scripts/pack.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index ce46f54..98b0697 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2018 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2018 Konrad Hinsen <address@hidden>
 ;;; Copyright © 2018 Chris Marusich <address@hidden>
+;;; Copyright © 2018 Efraim Flashner <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -609,6 +610,18 @@ please email '~a'~%")
     (squashfs . ,squashfs-image)
     (docker  . ,docker-image)))
 
+(define (show-formats)
+  ;; Print the supported pack formats.
+  (display (G_ "The supported formats for 'guix pack' are:"))
+  (newline)
+  (display (G_ "
+  tarball       Self-contained tarball, ready to run on another machine"))
+  (display (G_ "
+  squashfs      Squashfs image suitable for Singularity"))
+  (display (G_ "
+  docker        Tarball ready for 'docker load'"))
+  (newline))
+
 (define %options
   ;; Specifications of the command-line options.
   (cons* (option '(#\h "help") #f #f
@@ -625,6 +638,10 @@ please email '~a'~%")
          (option '(#\f "format") #t #f
                  (lambda (opt name arg result)
                    (alist-cons 'format (string->symbol arg) result)))
+         (option '("list-formats") #f #f
+                 (lambda args
+                   (show-formats)
+                   (exit 0)))
          (option '(#\R "relocatable") #f #f
                  (lambda (opt name arg result)
                    (alist-cons 'relocatable? #t result)))
@@ -687,6 +704,8 @@ Create a bundle of PACKAGE.\n"))
   (display (G_ "
   -f, --format=FORMAT    build a pack in the given FORMAT"))
   (display (G_ "
+      --list-formats     list the formats available"))
+  (display (G_ "
   -R, --relocatable      produce relocatable executables"))
   (display (G_ "
   -e, --expression=EXPR  consider the package EXPR evaluates to"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]