add limit for selection lists

This commit is contained in:
yargo-moni 2017-06-21 17:30:09 +02:00
parent 51c1246c22
commit a7d7d6c587
1 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,8 @@ EOT
# #
# prompt is displayed when waiting for command # prompt is displayed when waiting for command
prompt |< prompt |<
# maxshow defines the maximum number of cards/lines to be displayed
maxshow 15
# kanban defines a kanban file, may be given several times # kanban defines a kanban file, may be given several times
# kanban /some/path/to/jobkanban.txt # kanban /some/path/to/jobkanban.txt
# kanban /another/path/to/privatekanban.md # kanban /another/path/to/privatekanban.md
@ -82,6 +84,8 @@ getselect(){
kbs="`getlines kanban <"$conf"`" kbs="`getlines kanban <"$conf"`"
currkan="`echo "$kbs" | head -n 1`" currkan="`echo "$kbs" | head -n 1`"
prompt=`getlines prompt <"$conf" | head -n 1` prompt=`getlines prompt <"$conf" | head -n 1`
maxshow=`getlines maxshow <"$conf" | head -n 1`
maxshow=${maxshow:-22}
#echo conf=$conf #echo conf=$conf
#echo kbs=$kbs #echo kbs=$kbs
#echo currkan=$currkan #echo currkan=$currkan
@ -103,7 +107,7 @@ showall(){
esac esac
echo echo
echo " $1" echo " $1"
cat "$kbs" | getlines "$f" | showselect "$f " cat $kbs | getlines "$f" | showselect "$f " | head -n $maxshow
} }
# replace lines (in any kanban) containing some ed pattern # replace lines (in any kanban) containing some ed pattern
@ -137,6 +141,7 @@ case $k in
CLIKANCONF=$CLIKANCONF CLIKANCONF=$CLIKANCONF
configfile=$conf configfile=$conf
editor=$editor editor=$editor
maxshow=$maxshow
configfile contents: configfile contents:
EOT EOT
sed -e 's/^/ /' $conf sed -e 's/^/ /' $conf