citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 31936a0bc2dbe5ec5b1e1aeb6cae3feaa6274df3
parent ab7790094d7d836f64a532c542278321e803628c
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 16 Nov 2020 00:20:17 -0800

fuzz stuff

Diffstat:
Mbin/fuzz-cd-dirname | 16+++++++++++-----
Dbin/fuzz-get-hist | 5-----
Abin/fuzz-notmuch-archive-inbox | 6++++++
Abin/fuzz-open-file | 4++++
Mbin/fuzz-show-fuzz-command | 4+++-
Abin/fuzz-show-hist | 5+++++
Mbin/recent-files | 1+
Mdotfiles/commands | 10++++++----
8 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/bin/fuzz-cd-dirname b/bin/fuzz-cd-dirname @@ -1,8 +1,14 @@ #!/usr/bin/env bash -set -e +set -eou pipefail + +ARG=${1:-""} ROOT="$PWD" -if [ -n "$1" ]; then - cd "$1" - ROOT="$1" +if [ -n "$ARG" ]; then + cd "$ARG" + ROOT="$ARG" fi -file="$(fuzz dirname)" && echo "cd \"$ROOT/$file\"" + +file="$($FUZZER)" +file="$(dirname "$file")" + +echo cd \"$ROOT/$file\" diff --git a/bin/fuzz-get-hist b/bin/fuzz-get-hist @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -e -fuzz-compress-hist -cmd_=$(<$HOME/.fuzzhist $FUZZER --tac) -printf "echo \"%s\"\n" "$cmd_" diff --git a/bin/fuzz-notmuch-archive-inbox b/bin/fuzz-notmuch-archive-inbox @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eou pipefail +threads_cmd="notmuch search --format=json ${@:-query:inbox} | $(fuzz-notmuch-select-threads)" +threads=$(eval "$threads_cmd") +fuzz-record-command "threads=\$($threads_cmd) && notmuch tag -inbox \$threads" +echo notmuch tag -inbox $threads diff --git a/bin/fuzz-open-file b/bin/fuzz-open-file @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -eou pipefail +file="$(fuzzer "$@")" +echo open \"$file\" diff --git a/bin/fuzz-show-fuzz-command b/bin/fuzz-show-fuzz-command @@ -1,2 +1,4 @@ #!/usr/bin/env bash -file=$(cutt -f3 $HOME/dotfiles/commands | $FUZZER) && dog "$file" +set -eou pipefail +file=$(cutt -f3 $HOME/dotfiles/commands | $FUZZER) +echo dog "$file" diff --git a/bin/fuzz-show-hist b/bin/fuzz-show-hist @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -e +fuzz-compress-hist +cmd_=$(<$HOME/.fuzzhist $FUZZER --tac) +echo echo -n "$cmd_" diff --git a/bin/recent-files b/bin/recent-files @@ -1,2 +1,3 @@ #!/usr/bin/env sh +fuzz-compress-hist grep ^edit ~/.fuzzhist | tac diff --git a/dotfiles/commands b/dotfiles/commands @@ -1,11 +1,13 @@ cd change directory fuzz-cd-dirname -pf edit file fuzz-edit-file +pf project file fuzz-edit-file rf recent files fuzz-recent-files eFl edit fuzz command list fuzz-edit-command-list eFc edit fuzz command fuzz-edit-command sFc show fuzz command fuzz-show-fuzz-command +of open file fuzz-open-file ec edit commands fuzz-edit-scripts sc show command fuzz-show-script +sh show history fuzz-show-hist Nc new command echo make-script cc compile fuzz-compile cr compile repeat fuzz-compile-repeat @@ -16,11 +18,11 @@ sp search project fuzz-search-files Sr systemd restart fuzz-systemd-restart Ss systemd start fuzz-systemd-start SS systemd stop fuzz-systemd-stop -h run fuzz hist fuzz-run-hist -H get fuzz hist fuzz-get-hist +h run history fuzz-run-hist tj tag jump fuzz-tag-jump gb git branches echo git-bvr ni notmuch inbox fuzz-notmuch-inbox nt notmuch threads fuzz-notmuch-threads -na notmuch archive threads fuzz-notmuch-archive +na notmuch archive fuzz-notmuch-archive +nai notmuch archive inbox fuzz-notmuch-archive-inbox nq notmuch query fuzz-notmuch-query