pimgen: change -o option to be a directory
Previously this was a single file but pimgen will
shortly be emitting multiple files.
Change-Id: I72693512aa62f323ce090cf8137dcb1251e05251
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/pimgen.py b/pimgen.py
index b511dd4..91d93d6 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -25,8 +25,8 @@
description='Phosphor Inventory Manager (PIM) YAML '
'scanner and code generator.')
parser.add_argument(
- '-o', '--output', dest='output',
- default='generated.cpp', help='Output file name.')
+ '-o', '--output-dir', dest='outputdir',
+ default='.', help='Output directory.')
parser.add_argument(
'-d', '--dir', dest='inputdir',
default=os.path.join(script_dir, 'example'),
@@ -50,7 +50,7 @@
with open(os.path.join(args.inputdir, 'interfaces.yaml'), 'r') as fd:
interfaces = yaml.load(fd.read())
- with open(args.output, 'w') as fd:
+ with open(os.path.join(args.outputdir, 'generated.cpp'), 'w') as fd:
fd.write(
t.render(
interfaces=interfaces,