shtk_config_override man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

SHTK_CONFIG_OVERRIDE(3)	 BSD Library Functions Manual  SHTK_CONFIG_OVERRIDE(3)

NAME
     shtk_config_override — Records an override to be applied to the configu‐
     ration

LIBRARY
     shtk_import config

SYNOPSIS
     shtk_config_override override

DESCRIPTION
     The shtk_config_override function records the override given in override,
     which must have the form ‘variable=value’.

     Overrides are values given to configuration variables that can be set
     before the configuration file is loaded with shtk_config_load(3).	This
     feature is useful to support parsing all command line flags before
     attempting to load the configuration file, as the script should first
     validate all user input before performing any action.

EXAMPLES
     This code snippet illustrates a program with a configuration file that
     supports a VERBOSE variable and that, for convenience reasons, can be
     overriden via the command line using the -v flag:

	   shtk_config_init VERBOSE

	   local OPTIND
	   while getopts ':v' arg "${@}"; do
	       case "${arg}" in
		   v)  # Enable verbose mode.
		       shtk_config_override VERBOSE=yes
		       ;;
		   \?)
		       shtk_cli_usage_error "Unknown option -${OPTARG}"
		       ;;
	       esac
	   done
	   shift $((${OPTIND} - 1))

	   shtk_config_set VERBOSE no  # Set the default value.
	   shtk_config_load "/etc/my_program.conf"

SEE ALSO
     shtk(3), shtk_config(3)

HISTORY
     shtk_config_override first appeared in shtk 1.0.

BSD			       November 6, 2014				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net