From 71ef8907a8a81f2223d51c149c975105187a3048 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 5 Oct 2016 01:27:30 +0900 Subject: [PATCH] Removed snippet that doesn't work --- Examples.md | 56 ----------------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/Examples.md b/Examples.md index 473d948..2d40705 100644 --- a/Examples.md +++ b/Examples.md @@ -258,62 +258,6 @@ fi } ``` -### Toggle options - -```sh -# Toggle bash options (set and shopt) - -__do () -while - builtin read -r b o n _ -do - case ${b}${o} in - set+o) - builtin set -o "$n" - ;; - set-o) - builtin set +o "$n" - ;; - shopt-s) - builtin shopt -u "$n" - ;; - shopt-u) - builtin shopt -s "$n" - esac -done - -__select () -{ - builtin typeset \ - BOLD=$(command tput bold || command tput md;) \ - RESET=$(command tput sgr0 || command tput me;) \ - GREEN=$(command tput setaf 2 || command tput AF 2;) \ - RED=$(command tput setaf 1 || command tput AF 1;); - - command sed " - / -[so] / { - s/$/ ${BOLD}${GREEN}enabled${RESET}/; - b return - }; { - s/$/ ${BOLD}${RED}disabled${RESET}/; - }; - : return; - " \ - | command sort -k 3 \ - | command column -t \ - | command fzf --ansi --multi --with-nth=3.. --tiebreak=begin; -} - -__input () -{ - builtin shopt -p - builtin shopt -op -} - - -__do < <(__select < <(__input)) -``` - ### Processes ```sh