Commit 0783c069 authored by Eric Timmons's avatar Eric Timmons
Browse files

Implement context find

parent 5a0c79ab
......@@ -6,6 +6,7 @@
(uiop:define-package #:clpm/cli/context
(:use #:cl
#:clpm/cli/context/common
#:clpm/cli/context/find
#:clpm/cli/context/pathnames))
(in-package #:clpm/cli/context)
;;;; clpm context find
;;;;
;;;; This software is part of CLPM. See README.org for more information. See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/cli/context/find
(:use #:cl
#:alexandria
#:clpm/context
#:clpm/cli/context/common
#:clpm/cli/common-args
#:clpm/cli/subcommands
#:clpm/source)
(:import-from #:adopt))
(in-package #:clpm/cli/context/find)
(defparameter *context-find-ui*
(adopt:make-interface
:name "clpm context find"
:summary "Common Lisp Package Manager Context Find"
:usage "context find [options] SYSTEM-NAME"
:help "List the pathname to a system in the context"
:contents (list *group-common*
*option-context*
*option-output*)))
(define-cli-command (("context" "find") *context-find-ui*) (args options)
(assert (length= 1 args))
(let* ((context-name (gethash :context options "default"))
(context (get-context context-name))
(system-release (find (first args) (context-system-releases context)
:key (compose #'system-name #'system-release-system)
:test #'equal)))
(when system-release
(eswitch ((gethash :output options) :test 'equal)
(nil
(format t "~A~%" (system-release-absolute-asd-pathname system-release)))
("sexp"
(uiop:with-safe-io-syntax ()
(prin1 (system-release-absolute-asd-pathname system-release))
(terpri))))
t)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment