1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

Fix parsing by filtering the header outputed by ELinks

Also improve matching of option 'titles'.
This commit is contained in:
Jonas Fonseca 2006-01-03 15:17:23 +01:00 committed by Jonas Fonseca
parent 638e0406f1
commit e2a79aeacb

View File

@ -27,6 +27,7 @@ END_OF_USAGE
# Option handling {{{1 # Option handling {{{1
command= command=
filter=cat
prev_option= prev_option=
for option for option
@ -41,10 +42,12 @@ do
case "$option" in case "$option" in
--cmdoptions) --cmdoptions)
command="$elinks -long-help" command="$elinks -long-help"
filter="sed 0,/^Options:/d"
backend="cmdoptions" backend="cmdoptions"
;; ;;
--elinksconf) --elinksconf)
command="$elinks -config-help" command="$elinks -config-help"
filter="sed 0,/^Configuration/d"
backend="elinksconf" backend="elinksconf"
;; ;;
-) -)
@ -285,7 +288,7 @@ use_log=
$print_header $print_header
$command | while read line $command | $filter | while read line
do do
if test -n "$parse_description" if test -n "$parse_description"
then then
@ -323,7 +326,7 @@ do
case "$line" in case "$line" in
Features:*) Features:*)
;; ;;
[A-Z]*:*[a-z]*) [A-Z]*:" ("*[a-z]*)
parse_description=1 parse_description=1
title="`echo $line | sed -e 's/\([A-Z]*\):.*/\1/'`" title="`echo $line | sed -e 's/\([A-Z]*\):.*/\1/'`"
path="`echo $line | sed -e 's/.*: (\([a-z_].*\))/\1/'`" path="`echo $line | sed -e 's/.*: (\([a-z_].*\))/\1/'`"