From 3fba3e9f3e8475cf8b917ee5998d94b1fb9a0a35 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Fri, 20 Oct 2023 14:51:17 +0200 Subject: [PATCH] Some cleaning up --- src/bin/se | 7 ++++--- src/manpages/irs.1.scd | 15 ++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/bin/se b/src/bin/se index dacc87a..ea8df4b 100755 --- a/src/bin/se +++ b/src/bin/se @@ -1,11 +1,12 @@ #! /bin/sh +usage(){ printf "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim\n"; } if [ $# -eq 1 ] ; then case $1 in - --help) echo "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim";; - -h) echo "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim";; + --help) usage ;; + -h) usage ;; *) $EDITOR $(which $1);; esac else script=$(find ~/.local/bin -type f | sk --preview 'cat {}') - [ "$script" != "" ] && nvim $script || exit 0 + [ ! -z "$script" ] && $EDITOR $script || exit 0 fi diff --git a/src/manpages/irs.1.scd b/src/manpages/irs.1.scd index 19cf7e4..4f60712 100644 --- a/src/manpages/irs.1.scd +++ b/src/manpages/irs.1.scd @@ -1,9 +1,10 @@ -se(1) +irs(1) # NAME -*irs* - because -- and I quote: "Random collection of scripts. The IRS collects -taxes. You send a wrong amount of taxes, they randomly send you to jail." +*irs* - because -- and I quote: "Random collection [of scripts]. The IRS +collects taxes. You send a wrong amount of taxes, they randomly send you to +jail." # DESCRIPTION @@ -15,12 +16,12 @@ both problems. # SCRIPTS *se* - short for 'script edit'; when not given any arguments opens '*~/.local/bin*' - in *sk(1)* and allows you to make a seletion of what item in there using - *$EDITOR* + Abbreviated form of 'script edit'; when not given any arguments opens + '*~/.local/bin*' in *sk(1)* and allows you to make a selection of what item + in there using *$EDITOR*. Usage can be printed with '-h'. *open-bookmark* - opens a bookmark in *xdg-open(1)*, see its own manpage for more information + Opens a bookmark in *xdg-open(1)*, see its own manpage for more information # SEE ALSO