new-words

diff misc/nw-shell @ 48:7194bdb56475

new feature: -r and -R can specify number of words (or percentage) to show
author Igor Chubin <igor@chub.in>
date Tue Feb 08 20:35:38 2011 +0200 (2011-02-08)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/misc/nw-shell	Tue Feb 08 20:35:38 2011 +0200
     1.3 @@ -0,0 +1,11 @@
     1.4 +TEMP=`mktemp /tmp/nw-shell-XXXXXX`
     1.5 +~/hg/new-words/new-words-py.sh -n -l de "$1" | grep -v '^#' > "$TEMP"
     1.6 +rlwrap -f "$TEMP" sh -c '
     1.7 +    while true; 
     1.8 +    do 
     1.9 +        printf "\033[01;33m > " ;
    1.10 +        read word options || { exit; printf "\033[00m" ; } ;
    1.11 +        printf "\033[00m" ;
    1.12 +        de $word; 
    1.13 +    done'
    1.14 +rm $TEMP