diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-03 17:07:38 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-03 17:07:38 +1200 |
commit | 79dfc83485bfb3a5d171513bcf581749bbe02cf7 (patch) | |
tree | 72532a1ba7248578ca7973fd205a3970ecacfcd6 | |
parent | Merge branch 'release/v1.19.0' into develop (diff) | |
download | dotfiles-79dfc83485bfb3a5d171513bcf581749bbe02cf7.tar.gz dotfiles-79dfc83485bfb3a5d171513bcf581749bbe02cf7.zip |
Add mked(1df) and mkvi(1df)
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | bin/mked.sh | 6 | ||||
-rw-r--r-- | bin/mkvi.sh | 6 | ||||
-rw-r--r-- | man/man1/mked.1df | 16 | ||||
-rw-r--r-- | man/man1/mkvi.1df | 16 |
7 files changed, 51 insertions, 0 deletions
@@ -66,8 +66,10 @@ bin/mim.sh bin/mim.m4 bin/min bin/mkcp +bin/mked bin/mkmv bin/mktd +bin/mkvi bin/mode bin/motd bin/murl @@ -145,8 +145,10 @@ BINS = bin/ap \ bin/mim \ bin/min \ bin/mkcp \ + bin/mked \ bin/mkmv \ bin/mktd \ + bin/mkvi \ bin/mode \ bin/motd \ bin/murl \ @@ -489,6 +489,9 @@ Installed by the `install-bin` target: pipeline. * `ped(1df)` runs `pst(1df)` with `$EDITOR` or `ed(1)`. * `pvi(1df)` runs `pvi(1df)` with `$VISUAL` or `vi(1)`. +* Two editor wrapper tools: + * `mked(1df)` creates paths to all its arguments before invoking `$EDITOR`. + * `mkvi(1df)` creates paths to all its arguments before invoking `$VISUAL`. * `ap(1df)` reads arguments for a given command from the standard input, prompting if appropriate. * `apf(1df)` inserts arguments to a command with ones read from a file, diff --git a/bin/mked.sh b/bin/mked.sh new file mode 100644 index 00000000..4e280205 --- /dev/null +++ b/bin/mked.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Create paths to all files before invoking editor +for file ; do + mkdir -p -- "${file%/*}" || exit +done +exec "$EDITOR" "$@" diff --git a/bin/mkvi.sh b/bin/mkvi.sh new file mode 100644 index 00000000..244b89f8 --- /dev/null +++ b/bin/mkvi.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Create paths to all files before invoking editor +for file ; do + mkdir -p -- "${file%/*}" || exit +done +exec "$VISUAL" "$@" diff --git a/man/man1/mked.1df b/man/man1/mked.1df new file mode 100644 index 00000000..202ba386 --- /dev/null +++ b/man/man1/mked.1df @@ -0,0 +1,16 @@ +.TH MKVI 1df "July 2018" "Manual page for mked" +.SH NAME +.B mked +\- create paths to all argument files before invoking $EDITOR +.SH SYNOPSIS +.B mked +file0 dir1/file1 dir2/subdir/file2 +.SH DESCRIPTION +.B mked +iterates through its arguments and creates the full paths to each of them +before running $EDITOR with the same arguments. If the directory creation +fails, the script stops before invoking the editor. +.SH SEE ALSO +mked(1) +.SH AUTHOR +Tom Ryder <tom@sanctum.geek.nz> diff --git a/man/man1/mkvi.1df b/man/man1/mkvi.1df new file mode 100644 index 00000000..f0f215d4 --- /dev/null +++ b/man/man1/mkvi.1df @@ -0,0 +1,16 @@ +.TH MKVI 1df "July 2018" "Manual page for mkvi" +.SH NAME +.B mkvi +\- create paths to all argument files before invoking $VISUAL +.SH SYNOPSIS +.B mkvi +file0 dir1/file1 dir2/subdir/file2 +.SH DESCRIPTION +.B mkvi +iterates through its arguments and creates the full paths to each of them +before running $VISUAL with the same arguments. If the directory creation +fails, the script stops before invoking the editor. +.SH SEE ALSO +mked(1) +.SH AUTHOR +Tom Ryder <tom@sanctum.geek.nz> |