Deleted Added
full compact
bsdconfig (258420) bsdconfig (263980)
1#!/bin/sh
2#-
3# Copyright (c) 2012 Ron McDowell
1#!/bin/sh
2#-
3# Copyright (c) 2012 Ron McDowell
4# Copyright (c) 2012-2013 Devin Teske
4# Copyright (c) 2012-2014 Devin Teske
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
28# $FreeBSD: stable/10/usr.sbin/bsdconfig/bsdconfig 258420 2013-11-21 03:38:47Z dteske $
28# $FreeBSD: stable/10/usr.sbin/bsdconfig/bsdconfig 263980 2014-04-01 00:19:13Z dteske $
29#
30############################################################ INCLUDES
31
32# When common.subr is included, it automatically scans "$@" for `-d' and/or
33# `-D file' arguments to conditionally enable debugging. Similarly, when
34# dialog.subr is included, it automatically scans "$@" for `-X' and/or `-S'.
35# To prevent this scanning from becoming confused by extra options, define
36# any/all extra arguments to use in the optstring to getopts when scanning

--- 273 unchanged lines hidden (view full) ---

310#
311# If $0 is not "bsdconfig", interpret it either as a keyword to a menuitem or
312# as a valid resword (see script.subr for additional details about reswords).
313#
314if [ "$pgm" != "bsdconfig" ]; then
315 if indexfile=$( f_index_file "$pgm" ) &&
316 cmd=$( f_index_menusel_command "$indexfile" "$pgm" )
317 then
29#
30############################################################ INCLUDES
31
32# When common.subr is included, it automatically scans "$@" for `-d' and/or
33# `-D file' arguments to conditionally enable debugging. Similarly, when
34# dialog.subr is included, it automatically scans "$@" for `-X' and/or `-S'.
35# To prevent this scanning from becoming confused by extra options, define
36# any/all extra arguments to use in the optstring to getopts when scanning

--- 273 unchanged lines hidden (view full) ---

310#
311# If $0 is not "bsdconfig", interpret it either as a keyword to a menuitem or
312# as a valid resword (see script.subr for additional details about reswords).
313#
314if [ "$pgm" != "bsdconfig" ]; then
315 if indexfile=$( f_index_file "$pgm" ) &&
316 cmd=$( f_index_menusel_command "$indexfile" "$pgm" )
317 then
318 f_dprintf "pgm=[%s] indexfile=[%s] cmd=[%s]" \
319 "$pgm" "$indexfile" "$cmd"
318 f_dprintf "pgm=[%s] cmd=[%s] *=[%s]" "$pgm" "$cmd" "$*"
320 exec "$cmd" "$@" || exit 1
321 else
322 f_include $BSDCFG_SHARE/script.subr
323 for resword in $RESWORDS; do
324 [ "$pgm" = "$resword" ] || continue
325 # Found a match
326 f_dprintf "pgm=[%s] A valid resWord!" "$pgm"
319 exec "$cmd" "$@" || exit 1
320 else
321 f_include $BSDCFG_SHARE/script.subr
322 for resword in $RESWORDS; do
323 [ "$pgm" = "$resword" ] || continue
324 # Found a match
325 f_dprintf "pgm=[%s] A valid resWord!" "$pgm"
327 f_dispatch $resword
326 f_dispatch $resword $resword "$@"
328 exit $?
329 done
330 fi
331fi
332
333#
334# Process command-line arguments
335#

--- 41 unchanged lines hidden (view full) ---

377 cmd=$( f_index_menusel_command "$indexfile" "$1" )
378 }; then
379 # no matches, display usage (which shows valid keywords)
380 f_err "%s: %s: $msg_not_found\n" "$pgm" "$1"
381 usage
382 # Not reached
383 fi
384
327 exit $?
328 done
329 fi
330fi
331
332#
333# Process command-line arguments
334#

--- 41 unchanged lines hidden (view full) ---

376 cmd=$( f_index_menusel_command "$indexfile" "$1" )
377 }; then
378 # no matches, display usage (which shows valid keywords)
379 f_err "%s: %s: $msg_not_found\n" "$pgm" "$1"
380 usage
381 # Not reached
382 fi
383
384 f_dprintf "cmd=[%s] *=[%s]" "$cmd" "$*"
385 shift
386 exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1
387 # Not reached
388fi
389
390#
391# Launch application main menu
392#

--- 36 unchanged lines hidden ---
385 shift
386 exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1
387 # Not reached
388fi
389
390#
391# Launch application main menu
392#

--- 36 unchanged lines hidden ---