5 echo "ERROR: Run this script in the oscam source directory (where oscam.c file is)."
9 OPTS
=`grep "static const char short_options" oscam.c | sed -e 's|.* \"||;s|\".*||;s|:||g;s|\(.\)|\1 |g'`
10 SOPTS
=$
((for i
in $OPTS; do echo $i; done) |
sort)
11 LOPTS
=$
(grep "^ { \"" oscam.c |
sed -e 's|.*{ \"||;s|".*||')
19 echo -en "Short options that are free to use:\n "
20 for i
in $
(echo {A..Z
}) $
(echo {a..z
}) $
(echo {0.
.9})
22 echo $OPTS |
grep -q $i 2>/dev
/null
31 echo -en "Options that are not processed in oscam.c (missing case 'x'):\n "
32 #AOPTS="$FOPTS $SOPTS"
36 grep -q "case '$i'" oscam.c
2>/dev
/null
37 [ $?
!= 0 ] && echo -n $i
41 echo -en "Short options that are missing from 'struct long_options[]'\n "
44 grep -q "NULL, '$i' }," oscam.c
2>/dev
/null
45 [ $?
!= 0 ] && echo -n $i
49 echo -en "No help entry in usage() for short options:\n "
52 grep -q " printf(\" -$i" oscam.c
2>/dev
/null
53 [ $?
!= 0 ] && echo -n $i
57 echo "No help entry in usage() long options:"
60 grep -q " printf(\" -., --$i" oscam.c
2>/dev
/null
61 [ $?
!= 0 ] && echo " $i"