diff options
author | JSDurand <mmemmew@gmail.com> | 2023-02-21 21:03:37 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2023-02-21 21:03:37 +0800 |
commit | 51bf374f4ed9df9ffa5b34ab0f1a2ab6387840dd (patch) | |
tree | d9c13a01c5bcb4fdbc3fa3eed1cd918d2b674cef | |
parent | ee77fcd68760dd826c174e3e22e93d6f1a6247c0 (diff) |
eshell: Allow setting directory in the gv command
* eshell-conf.el (eshell/gv, eshell-gv): Now we can set the directory
that contains the output directory explicitly in the command line.
It used to be hard-coded to be the root of the project. It is more
flexible now.
-rw-r--r-- | eshell-conf.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/eshell-conf.el b/eshell-conf.el index ba14746..6e1b545 100644 --- a/eshell-conf.el +++ b/eshell-conf.el @@ -574,6 +574,7 @@ on `args'." (?f "format" t image-format "Which image format to output") (?r "remove" nil removep "Whether to remove images or not") (?R "remove-all" nil remove-allp "Whether to remove images and sources or not") + (?d "root" t dir "Set the directory that contains the output directory") :usage "[-f format] [-r|-R] [graphviz file names...] This little command can perform two tasks: @@ -585,15 +586,16 @@ The file names should not include any extension." :parse-leading-options-only :show-usage) (let ((removep (cond (remove-allp 'all) (removep)))) - (eshell-gv image-format removep args)))) + (eshell-gv image-format removep dir args)))) (require 'vc) -(defun eshell-gv (image-format removep &rest args) +(defun eshell-gv (image-format removep dir &rest args) "Internal function for `eshell/gv'." (let ((args (car args)) (image-format (cond (image-format) ("png"))) - (root-dir (expand-file-name "output" (vc-root-dir)))) + (root-dir + (expand-file-name "output" (cond (dir) ((vc-root-dir)))))) (cond (removep (mapc |