A script to create the various case statements to set variables from the command line and optionally insert them into a file, switches can be created from the commands to the makeswitch script or via a config file, see the man page and example files for full details simple help is:
Code:
makeswitch -?
Usage: makeswitch [OPTION]... [FORMAT]...
-b|--binary : Binary states 'ON/OFF'
-s|--string : String initial state
-i|--init : Initialize variable
-n|--no-init : Don't initialize variable
-c|--config : Use config file f
-a|--app-name : Set the application name
-v|--version : Set the application version
-x|--xtra-help : Add 'args' to 'help' option
FORMAT = n:nnn:vartype:info ...
Where n:nnn = short:long-opt
vartype = [b|s|n] [binary, string or null]
info string for help
Config file example:
APPNAME appname
VERSION 0.1.0
OUTPUTFILE EncodeVideo/encodevideo.startup
Initialize following variables
INIT
Don't initialize following variables
NOINIT
BINSTATES Yes/No
STRING "Initial string value"
SWITCH f:file:s:"Encode file FILE"
SWITCH k:keep:b:"Save sorted original comics"
Paste into front of file FILE (upto ###CUT###)
PASTE FILE
Version 0.2.1
I have not included the script here as It is still under development and there is also a man page and example files, so please download the archive from here:
http://keithhedger.hostingsiteforfree.com/zips/makeswitch.tgz