Skip to content

Commit

Permalink
Add --template option to optimade-client CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Nov 20, 2020
1 parent fe23ba4 commit ba46990
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions optimade_client/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ def main(args: list = None):
action="store_true",
help="Attempt to open a browser upon starting the Voilà tornado server.",
)
parser.add_argument(
"--template",
type=str,
help="Use another template than the default.",
)

args = parser.parse_args(args)
log_level = args.log_level
debug = args.debug
open_browser = args.open_browser
template = args.template

# Make sure Voilà is installed
if voila is None:
Expand Down Expand Up @@ -88,4 +94,7 @@ def main(args: list = None):
if "--debug" not in argv:
argv.append(f"--Voila.log_level={getattr(logging, log_level.upper())}")

if template:
argv.append(f"--template={template}")

voila(argv)

0 comments on commit ba46990

Please sign in to comment.