From 51bf374f4ed9df9ffa5b34ab0f1a2ab6387840dd Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 21 Feb 2023 21:03:37 +0800 Subject: 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. --- eshell-conf.el | 8 +++++--- 1 file 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 -- cgit v1.2.3-18-g5258