aboutsummaryrefslogtreecommitdiffstats
path: root/mako/cmd.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-03-25 16:04:16 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-03-25 16:04:16 -0400
commit22fb044c3cb177aa197af1877c1c67e3f70066b7 (patch)
tree11cfb88f09a0ef722dac4e60feb36dedb358cccd /mako/cmd.py
parent6e78429b202362a9ed99decdf79bde978ce354de (diff)
downloadexternal_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.tar.gz
external_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.tar.bz2
external_python_mako-22fb044c3cb177aa197af1877c1c67e3f70066b7.zip
- get flake8 to pass fully for mako/ (tests are a much bigger deal)
Diffstat (limited to 'mako/cmd.py')
-rwxr-xr-xmako/cmd.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/mako/cmd.py b/mako/cmd.py
index 1a9ca56..50d47fc 100755
--- a/mako/cmd.py
+++ b/mako/cmd.py
@@ -10,26 +10,31 @@ from mako.template import Template
from mako.lookup import TemplateLookup
from mako import exceptions
+
def varsplit(var):
if "=" not in var:
return (var, "")
return var.split("=", 1)
+
def _exit():
sys.stderr.write(exceptions.text_error_template().render())
sys.exit(1)
+
def cmdline(argv=None):
parser = ArgumentParser("usage: %prog [FILENAME]")
- parser.add_argument("--var", default=[], action="append",
- help="variable (can be used multiple times, use name=value)")
- parser.add_argument("--template-dir", default=[], action="append",
- help="Directory to use for template lookup (multiple "
- "directories may be provided). If not given then if the "
- "template is read from stdin, the value defaults to be "
- "the current directory, otherwise it defaults to be the "
- "parent directory of the file provided.")
+ parser.add_argument(
+ "--var", default=[], action="append",
+ help="variable (can be used multiple times, use name=value)")
+ parser.add_argument(
+ "--template-dir", default=[], action="append",
+ help="Directory to use for template lookup (multiple "
+ "directories may be provided). If not given then if the "
+ "template is read from stdin, the value defaults to be "
+ "the current directory, otherwise it defaults to be the "
+ "parent directory of the file provided.")
parser.add_argument('input', nargs='?', default='-')
options = parser.parse_args(argv)