diff options
| author | Dan Davison <dandavison7@gmail.com> | 2020-08-08 10:36:00 -0400 |
|---|---|---|
| committer | Dan Davison <dandavison7@gmail.com> | 2020-08-08 11:53:57 -0400 |
| commit | aa1bb5c424e8ba63f5caa9c4e6b4894d6db348b4 (patch) | |
| tree | 921316d0129b3ca6dc3f4033c170467b1df7358d | |
| parent | 51354eec1e76be3b7a7d9769114e0e3fd32dcdc1 (diff) | |
Shell scripts
| -rwxr-xr-x | etc/bin/ansifilter | 1 | ||||
| -rwxr-xr-x | etc/bin/check-show-config-options | 4 | ||||
| -rwxr-xr-x | etc/bin/diagnostics (renamed from etc/diagnostics) | 0 | ||||
| -rwxr-xr-x | etc/bin/list-options | 11 | ||||
| -rwxr-xr-x | tests/test_raw_output_matches_git_on_full_repo_history | 3 |
5 files changed, 18 insertions, 1 deletions
diff --git a/etc/bin/ansifilter b/etc/bin/ansifilter new file mode 100755 index 0000000..f029a32 --- /dev/null +++ b/etc/bin/ansifilter @@ -0,0 +1 @@ +perl -pe 's/\e\[[0-9;]*[mK]//g'
\ No newline at end of file diff --git a/etc/bin/check-show-config-options b/etc/bin/check-show-config-options new file mode 100755 index 0000000..cc5a8ce --- /dev/null +++ b/etc/bin/check-show-config-options @@ -0,0 +1,4 @@ +#!/bin/bash +DIR=$(dirname ${BASH_SOURCE[0]}) + +delta <($DIR/list-options) <(delta --show-config | awk '{print $1}' | sort) diff --git a/etc/diagnostics b/etc/bin/diagnostics index 2cf5c5a..2cf5c5a 100755 --- a/etc/diagnostics +++ b/etc/bin/diagnostics diff --git a/etc/bin/list-options b/etc/bin/list-options new file mode 100755 index 0000000..6c991fc --- /dev/null +++ b/etc/bin/list-options @@ -0,0 +1,11 @@ +#!/bin/bash + +DIR=$(dirname ${BASH_SOURCE[0]}) + +delta --help | \ + $DIR/ansifilter | \ + rg ' --[^-].+ <' | \ + rg -v 'deprecated' | \ + awk 'BEGIN{FS="--"}; {print $2}' | \ + awk '{print $1}' | \ + sort diff --git a/tests/test_raw_output_matches_git_on_full_repo_history b/tests/test_raw_output_matches_git_on_full_repo_history index 8dcde90..7414870 100755 --- a/tests/test_raw_output_matches_git_on_full_repo_history +++ b/tests/test_raw_output_matches_git_on_full_repo_history @@ -1,4 +1,5 @@ #!/bin/bash DELTA="./target/release/delta --no-gitconfig --raw" +ANSIFILTER="./etc/bin/ansifilter" GIT_ARGS="log --patch --stat --numstat" -diff -u <(git $GIT_ARGS | perl -pe 's/\e\[[0-9;]*[mK]//g') <(git $GIT_ARGS | $DELTA | perl -pe 's/\e\[[0-9;]*[mK]//g') +diff -u <(git $GIT_ARGS | $ANSIFILTER) <(git $GIT_ARGS | $DELTA | $ANSIFILTER) |
