diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2023-06-04 16:49:20 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2023-06-04 16:54:10 +0200 |
| commit | 11fcabc479b8a401c2189bed8f500db9af08cd47 (patch) | |
| tree | 552aea1f36c945353c42be745331cce0eeef2bca /.emacs | |
| parent | 99dbb07618bf017fb66f457994d5ab0aa39c4eea (diff) | |
| download | dotfiles-11fcabc479b8a401c2189bed8f500db9af08cd47.tar.xz | |
Add command to show --help for CLI commands
Diffstat (limited to '.emacs')
| -rw-r--r-- | .emacs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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))) |
