Bringing both together

 

In some programs (like storeBackup.pl) you can use both command line options and a configuration file. Normally, it is easier and more clearly to use the configuration file.

But in some situations it is very convenient to be able to overwrite an option set in the configuration file. You can simply do this by additionally setting that option on the command line. In programs delivered with storeBackup the command line will overrule the settings in the configuration file.

There is one special kind of situation when this normally would not be possible. Imagine, you wrote in the configuration file of storeBackup.pl:

doNotDelete = yes

This means, storeBackup.pl will not delete any old backup, because you want to do this later with storeBackupDel.pl. But the only thing storeBackupDel.pl has to offer is an option as a flag: --doNotDelete which only means yes in the configuration file. There's no special option to say no. Instead of introducing dozens of options for such cases, these programs use the following syntax:

# storeBackupDel.pl -f backup.config --unset doNotDelete

This will ``unset'' the doNotDelete option set in the configuration file.

You can also write:

# storeBackupDel.pl -f backup.config --unset --doNotDelete

which is the name of this option on the command line.

For list parameters, there is a mapping from the list parameters without option to a special option in the configuration file - for storeBackup.pl that's otherBackupSeries, for storeBackupSearch.pl it is backupRoot. This is documented for the individual programs (see description).

Heinz-Josef Claes 2014-04-20