summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-06-16 00:03:37 -0600
committerTavian Barnes <tavianator@gmail.com>2011-06-16 00:08:22 -0600
commit1c9b8fa88e290ef2b66f049c99b812f378d30ee3 (patch)
tree48e0855680fb3bc411e127a5992b336c54d49e1e /dimension
parent817532b031cb9a15ccf27ff66d8031b31abce200 (diff)
downloaddimension-1c9b8fa88e290ef2b66f049c99b812f378d30ee3.tar.xz
Use types for command-line options, and support --quality.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/dimension.in18
1 files changed, 11 insertions, 7 deletions
diff --git a/dimension/dimension.in b/dimension/dimension.in
index 1f26db0..b73ff1c 100644
--- a/dimension/dimension.in
+++ b/dimension/dimension.in
@@ -32,10 +32,10 @@ _parser = argparse.ArgumentParser(
_parser.add_argument('-V', '--version', action = 'version',
version = '@PACKAGE_NAME@ @PACKAGE_VERSION@')
-_parser.add_argument('-w', '--width', action = 'store', default = 768,
- help = 'image width')
-_parser.add_argument('-h', '--height', action = 'store', default = 480,
- help = 'image height')
+_parser.add_argument('-w', '--width', action = 'store', type = int,
+ default = 768, help = 'image width')
+_parser.add_argument('-h', '--height', action = 'store', type = int,
+ default = 480, help = 'image height')
_parser.add_argument('-v', '--verbose', action = 'store_true',
help = 'print more information')
@@ -44,12 +44,14 @@ _parser.add_argument('-q', '--quiet', action = 'store_true',
_parser.add_argument('--strict', action = 'store_true',
help = 'treat warnings as errors')
-_parser.add_argument('--threads', action = 'store',
+_parser.add_argument('--threads', action = 'store', type = int,
help = 'the number of threads to render with')
+_parser.add_argument('--quality', action = 'store', type = int,
+ help = 'the scene quality')
-_parser.add_argument('-o', '--output', action = 'store',
+_parser.add_argument('-o', '--output', action = 'store', type = str,
help = 'the output image file')
-_parser.add_argument('input', action = 'store',
+_parser.add_argument('input', action = 'store', type = str,
help = 'the input scene description file')
_args = _parser.parse_args()
@@ -101,6 +103,8 @@ if recursion_limit is not None:
scene.recursion_limit = recursion_limit
if _args.threads is not None:
scene.nthreads = _args.threads
+if _args.quality is not None:
+ scene.quality = _args.quality
# Raytrace the scene
if not _args.quiet: