dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit 11fcabc479b8a401c2189bed8f500db9af08cd47
parent 99dbb07618bf017fb66f457994d5ab0aa39c4eea
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sun,  4 Jun 2023 16:49:20 +0200

Add command to show --help for CLI commands

Diffstat:
M.emacs | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/.emacs b/.emacs @@ -205,6 +205,14 @@ (call-process-shell-command command nil t) (my/kill (buffer-string)))) +(defun my/shell-command-help (command) + (interactive + (list (read-shell-command "Show --help for: "))) + (let* ((command--help (concat command " --help")) + (help-buf (get-buffer-create (format "*%s*" command--help)))) + (shell-command (concat command--help) help-buf) + (display-buffer help-buf))) + (defun my/make-project-wide (f) "Make a function which will run F from the project's root directory." (lambda () @@ -266,7 +274,8 @@ (my/define-prefix-command my/manual-map "Keymap for reading manuals." - '(("i" info-display-manual) + '(("h" my/shell-command-help) + ("i" info-display-manual) ("m" man) ("s" shortdoc-display-group)))