You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/12/28 00:42:37 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #6881: [AIRFLOW-6326] Sort cli commands and arg

mik-laj commented on a change in pull request #6881: [AIRFLOW-6326] Sort cli commands and arg
URL: https://github.com/apache/airflow/pull/6881#discussion_r361766491
 
 

 ##########
 File path: airflow/bin/cli.py
 ##########
 @@ -1022,10 +1022,10 @@ def _add_subcommand(cls, subparsers, sub):
         if subcommands:
             sub_subparsers = sub_proc.add_subparsers(dest='subcommand')
             sub_subparsers.required = True
-            for command in subcommands:
+            for command in sorted(subcommands, key=lambda x: x['name']):
                 cls._add_subcommand(sub_subparsers, command)
         else:
-            for arg in sub['args']:
+            for arg in sorted(sub['args'], key=lambda x: cls.args[x].flags[0]):
 
 Review comment:
   The current order of the elements is random. No one had ever dealt with their order before. I think we don't have to worry about the current order.  I prefer alphabetical order.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services