changeset 689: |
2e7d93b892a5 |
parent: |
af486e0a40c9
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Tue, 01 Oct 2024 22:29:08 -0400 |
permissions: |
-rw-r--r-- |
description: |
cli shell tests init |
1 ;;; organ.lisp --- Org-mode utility 7 (:use :cl :organ :std :cli :log :clap)) 9 (in-package :bin/organ) 10 (defopt organ-help (print-help *cli*)) 11 (defopt organ-version (print-version *cli*)) 12 (defopt organ-log-level (setq *log-level* (if *arg* t :info))) 13 ;; (defopt organ-output (when *arg* (trace! (or *arg* "output.organ")))) 14 (defcmd organ-describe 17 (describe (org-parse :document (pathname (car *args*)))) 18 (describe (org-parse :document #P"readme.org")))) 23 (inspect (org-parse :document (pathname (car *args*)))) 24 (inspect (org-parse :document #P"readme.org")))) 28 (print (org-parse-lines t (uiop:read-file-string (car *args*)))) 29 (error! "missing file arg"))) 32 (let ((input (if *args* (car *args*) #P"readme.org"))) 33 (describe (org-parse :document input)))) 35 (define-cli *organ-cli* 38 :description "org-mode toolbox" 39 :thunk 'organ-describe 40 :opts ((:name "level" :description "set the log level" :thunk organ-log-level) 41 (:name "help" :description "print help" :thunk organ-help) 42 (:name "version" :description "print version" :thunk organ-version) 43 ;; (:name "output" :description "output file" :kind file :thunk organ-output) 46 :description "inspect an org file" 49 :description "display local org info" 52 :description "describe local org info" 53 :thunk organ-describe) 58 (let ((*log-level* :info)) 59 (with-cli (*organ-cli* opts cmds args) (cli:args) 63 (defmain start-organ ()