Allow user to override freezefile.
This commit is contained in:
parent
bbfdb2e64b
commit
1a25fbcd77
@ -16,6 +16,8 @@ parser = argparse.ArgumentParser(
|
||||
epilog='For further information, please check the documentation.')
|
||||
parser.add_argument('config', metavar='CONFIG', type=str,
|
||||
help='freeze file cofiguration')
|
||||
parser.add_argument('--db', default=None,
|
||||
help='Override the freezefile database URI')
|
||||
|
||||
|
||||
def freeze(result, format='csv', filename='freeze.csv',
|
||||
@ -91,6 +93,8 @@ def main():
|
||||
args = parser.parse_args()
|
||||
config = Configuration(args.config)
|
||||
for export in config.exports:
|
||||
if args.db is not None:
|
||||
export.data['database'] = args.db
|
||||
if export.skip:
|
||||
log.info("Skipping: %s", export.name)
|
||||
continue
|
||||
|
||||
@ -22,7 +22,10 @@ freeze file as its argument:
|
||||
|
||||
datafreeze Freezefile.yaml
|
||||
|
||||
Freeze files can be either written in JSON or in YAML.
|
||||
Freeze files can be either written in JSON or in YAML. The database URI
|
||||
indicated in the Freezefile can also be overridden via the command line:
|
||||
|
||||
datafreeze --db sqlite:///foo.db Freezefile.yaml
|
||||
|
||||
|
||||
Example Freezefile.yaml
|
||||
|
||||
Loading…
Reference in New Issue
Block a user