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

 ##########
 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:
   @potiuk @ashb @mik-laj Could you please take a look if have time?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to