Fix 'doom env' refusing arguments/options
This commit is contained in:
parent
b6cc110f4c
commit
10a4e6570d
1 changed files with 10 additions and 15 deletions
|
@ -4,7 +4,7 @@
|
||||||
((allow ["-a" "--allow" regexp] "An envvar whitelist regexp")
|
((allow ["-a" "--allow" regexp] "An envvar whitelist regexp")
|
||||||
(reject ["-r" "--reject" regexp] "An envvar blacklist regexp")
|
(reject ["-r" "--reject" regexp] "An envvar blacklist regexp")
|
||||||
(clear-p ["-c" "--clear"] "Clear and delete your envvar file")
|
(clear-p ["-c" "--clear"] "Clear and delete your envvar file")
|
||||||
(outputfile ["-o" PATH]
|
(outputfile ["-o" path]
|
||||||
"Generate the envvar file at PATH. Envvar files that aren't in
|
"Generate the envvar file at PATH. Envvar files that aren't in
|
||||||
`doom-env-file' won't be loaded automatically at startup. You will need to load
|
`doom-env-file' won't be loaded automatically at startup. You will need to load
|
||||||
them manually from your private config with the `doom-load-envvars-file'
|
them manually from your private config with the `doom-load-envvars-file'
|
||||||
|
@ -40,20 +40,15 @@ Why this over exec-path-from-shell?
|
||||||
or not at all. It frontloads the debugging process rather than hiding it
|
or not at all. It frontloads the debugging process rather than hiding it
|
||||||
until you least want to deal with it."
|
until you least want to deal with it."
|
||||||
(let ((env-file (expand-file-name (or outputfile doom-env-file))))
|
(let ((env-file (expand-file-name (or outputfile doom-env-file))))
|
||||||
(cond (clear-p
|
(if (null clear-p)
|
||||||
(unless (file-exists-p env-file)
|
(doom-cli-reload-env-file
|
||||||
(user-error! "%S does not exist to be cleared"
|
'force env-file (list allow) (list reject))
|
||||||
(path env-file)))
|
(unless (file-exists-p env-file)
|
||||||
(delete-file env-file)
|
(user-error! "%S does not exist to be cleared"
|
||||||
(print! (success "Successfully deleted %S")
|
(path env-file)))
|
||||||
(path env-file)))
|
(delete-file env-file)
|
||||||
|
(print! (success "Successfully deleted %S")
|
||||||
((and args (not (or allow reject)))
|
(path env-file)))))
|
||||||
(user-error "I don't understand 'doom env %s'"
|
|
||||||
(string-join args " ")))
|
|
||||||
|
|
||||||
((doom-cli-reload-env-file
|
|
||||||
'force env-file (list allow) (list reject))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue