From 271cc084a1ea0162d1952bdde6d0def872c817c0 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 15 Mar 2022 00:54:21 +0000 Subject: jao-dirmon: one of those little things --- lib/eos/jao-shell.el | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/eos/jao-shell.el (limited to 'lib/eos/jao-shell.el') diff --git a/lib/eos/jao-shell.el b/lib/eos/jao-shell.el new file mode 100644 index 0000000..f3ce438 --- /dev/null +++ b/lib/eos/jao-shell.el @@ -0,0 +1,37 @@ +;;; jao-shell.el --- shell utils -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 jao + +;; Author: jao +;; Keywords: shell + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; shell helpers + +;;; Code: + +(defun jao-shell-cmd-lines (cmd &rest args) + (let ((cmd (concat cmd " " + (mapconcat #'shell-quote-argument args " ")))) + (split-string (shell-command-to-string cmd) "\n" t))) + + +(defun jao-shell-cmd-line (cmd &rest args) + (car (apply #'jao-shell-cmd-lines cmd args))) + +(provide 'jao-shell) +;;; jao-shell.el ends here -- cgit v1.2.3