summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-11-30 23:19:45 +0100
committerLudovic Courtès <ludo@gnu.org>2019-12-07 00:59:57 +0100
commit158032bd7dcc33d17da8091b2319bf59ee9db6a1 (patch)
treefdc9f9f8241caceee48683868a0cf3f973123fee /guix/scripts
parent60f4564a63316c5655cfd1e01ea2ebfdd9cfb9f1 (diff)
downloadpatches-158032bd7dcc33d17da8091b2319bf59ee9db6a1.tar
patches-158032bd7dcc33d17da8091b2319bf59ee9db6a1.tar.gz
guix system: Add "describe" action.
* guix/scripts/system.scm (show-help): Add "describe". (process-command): Handle it. (guix-system): Likewise. * doc/guix.texi (Invoking guix system): Document it.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/system.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 129c248283..3e9570753d 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -922,6 +922,8 @@ Some ACTIONS support additional ARGS.\n"))
(display (G_ "\
roll-back switch to the previous operating system configuration\n"))
(display (G_ "\
+ describe describe the current system\n"))
+ (display (G_ "\
list-generations list the system generations\n"))
(display (G_ "\
switch-generation switch to an existing operating system configuration\n"))
@@ -1196,6 +1198,12 @@ argument list and OPTS is the option alist."
((pattern) pattern)
(x (leave (G_ "wrong number of arguments~%"))))))
(list-generations pattern)))
+ ((describe)
+ (match (generation-number %system-profile)
+ (0
+ (error (G_ "no system generation, nothing to describe~%")))
+ (generation
+ (display-system-generation generation))))
((search)
(apply (resolve-subcommand "search") args))
;; The following commands need to use the store, but they do not need an
@@ -1235,7 +1243,8 @@ argument list and OPTS is the option alist."
(case action
((build container vm vm-image disk-image reconfigure init
extension-graph shepherd-graph
- list-generations delete-generations roll-back
+ list-generations describe
+ delete-generations roll-back
switch-generation search docker-image)
(alist-cons 'action action result))
(else (leave (G_ "~a: unknown action~%") action))))))