dialog.subr (3c63cc68aede27b10861ec56db126766281b4642) | dialog.subr (b39eff3362b60b3f3b9ccff0a7f3bb543128b7fb) |
---|---|
1if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 2# 3# Copyright (c) 2006-2014 Devin Teske 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 2102 unchanged lines hidden (view full) --- 2111 echo $n 2112 return $SUCCESS 2113 fi 2114 n=$(( $n + 1 )) 2115 done 2116 return $FAILURE 2117} 2118 | 1if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 2# 3# Copyright (c) 2006-2014 Devin Teske 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 2102 unchanged lines hidden (view full) --- 2111 echo $n 2112 return $SUCCESS 2113 fi 2114 n=$(( $n + 1 )) 2115 done 2116 return $FAILURE 2117} 2118 |
2119# f_dialog_menutag2help $tag_chosen $tag1 $item1 $help1 $tag2 $item2 $help2 ... 2120# 2121# To use the `--menu' option of dialog(1) with the `--item-help' option, you 2122# must pass an ordered list of tag/item/help triplets on the command-line. When 2123# the user selects a menu option the tag for that item is printed to stderr. 2124# 2125# This function allows you to dereference the tag chosen by the user back into 2126# the help associated with said tag (item is discarded/ignored). 2127# 2128# Pass the tag chosen by the user as the first argument, followed by the 2129# ordered list of tag/item/help triplets (HINT: use the same tag/item/help list 2130# as was passed to dialog(1) for consistency). 2131# 2132# If the tag cannot be found, NULL is returned. 2133# 2134f_dialog_menutag2help() 2135{ 2136 local tag="$1" tagn help 2137 shift 1 # tag 2138 2139 while [ $# -gt 0 ]; do 2140 tagn="$1" 2141 help="$3" 2142 shift 3 # tagn/item/help 2143 2144 if [ "$tag" = "$tagn" ]; then 2145 echo "$help" 2146 return $SUCCESS 2147 fi 2148 done 2149 return $FAILURE 2150} 2151 |
|
2119############################################################ INIT FUNCTIONS 2120 2121# f_dialog_init 2122# 2123# Initialize (or re-initialize) the dialog module after setting/changing any 2124# of the following environment variables: 2125# 2126# USE_XDIALOG Either NULL or Non-NULL. If given a value will indicate --- 182 unchanged lines hidden --- | 2152############################################################ INIT FUNCTIONS 2153 2154# f_dialog_init 2155# 2156# Initialize (or re-initialize) the dialog module after setting/changing any 2157# of the following environment variables: 2158# 2159# USE_XDIALOG Either NULL or Non-NULL. If given a value will indicate --- 182 unchanged lines hidden --- |