@item --list-types
List the supported graph types.
+
+@item --expression=@var{expr}
+@itemx -e @var{expr}
+Consider the package @var{expr} evaluates to.
+
+This is useful to precisely refer to a package, as in this example:
+
+@example
+guix graph -e '(@@@@ (gnu packages commencement) gnu-make-final)'
+@end example
@end table
(lambda (opt name arg result)
(list-node-types)
(exit 0)))
+ (option '(#\e "expression") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'expression arg result)))
(option '(#\h "help") #f #f
(lambda args
(show-help)
-t, --type=TYPE represent nodes of the given TYPE"))
(display (_ "
--list-types list the available graph types"))
+ (display (_ "
+ -e, --expression=EXPR consider the package EXPR evaluates to"))
(newline)
(display (_ "
-h, --help display this help and exit"))
(with-error-handling
(let* ((opts (parse-command-line args %options
(list %default-options)))
- (specs (filter-map (match-lambda
- (('argument . spec) spec)
- (_ #f))
- opts))
(type (assoc-ref opts 'node-type))
- (packages (map specification->package specs)))
+ (packages (filter-map (match-lambda
+ (('argument . spec)
+ (specification->package spec))
+ (('expression . exp)
+ (read/eval-package-expression exp))
+ (_ #f))
+ opts)))
(with-store store
(run-with-store store
(mlet %store-monad ((nodes (mapm %store-monad
guix build guile-bootstrap
guix graph -t references guile-bootstrap | grep guile-bootstrap
+
+guix graph -e '(@ (gnu packages bootstrap) %bootstrap-guile)' \
+ | grep guile-bootstrap
+
+if guix graph -e +; then false; else true; fi