Function: eshell/addpath
eshell/addpath is a byte-compiled function defined in esh-ext.el.gz.
Signature
(eshell/addpath &rest ARGS)
Documentation
Add a set of paths to PATH.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-ext.el.gz
(defun eshell/addpath (&rest args)
"Add a set of paths to PATH."
(eshell-eval-using-options
"addpath" args
'((?b "begin" nil prepend "add path element at beginning")
(?h "help" nil nil "display this usage message")
:usage "[-b] PATH
Adds the given PATH to $PATH.")
(if args
(progn
(setq eshell-path-env (getenv "PATH")
args (mapconcat #'identity args path-separator)
eshell-path-env
(if prepend
(concat args path-separator eshell-path-env)
(concat eshell-path-env path-separator args)))
(setenv "PATH" eshell-path-env))
(dolist (dir (parse-colon-path (getenv "PATH")))
(eshell-printn dir)))))