From cdaf00a98ecd2ef8d512892c68545786c7fe45eb Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 21 Sep 2019 09:08:26 -0400 Subject: [PATCH] --sort --- bake/cli.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/bake/cli.py b/bake/cli.py index f75f6ea..0d2f9bd 100644 --- a/bake/cli.py +++ b/bake/cli.py @@ -158,14 +158,18 @@ def echo_json(obj): type=click.BOOL, help="Inherit parent shell's environment variables.", ) -@click.argument( - "arguments", - nargs=-1, - type=click.STRING, - # multiple=True, - # help="task ARGV argument (can be passed multiple times).", +@click.argument("arguments", nargs=-1, type=click.STRING) +@click.option( + "--silent", + "-s", + is_flag=True, + type=click.BOOL, + help="Reduce output.", + envvar="BAKE_SILENT", +) +@click.option( + "--sort", is_flag=True, type=click.BOOL, help="Sort tasks, alphabetially." ) -@click.option("--silent", "-s", is_flag=True, type=click.BOOL, help="Reduce output.") @click.option( "--environ-json", "-e", @@ -192,6 +196,7 @@ def entrypoint( environ_json, debug, silent, + sort, insecure, allow, _json, @@ -306,6 +311,9 @@ def entrypoint( else: task_list = bakefile.tasks + if sort: + task_list = sorted(task_list) + for _task in task_list: depends_on = bakefile[_task].depends_on( include_filters=False, recursive=True