airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [airflow] mik-laj commented on issue #6881: [AIRFLOW-6326] Sort cli commands and arg
Date Sat, 04 Jan 2020 20:18:27 GMT
mik-laj commented on issue #6881: [AIRFLOW-6326] Sort cli commands and arg
   I think, we can sort using followng function:
       def sort_args(cls, args):
           def partition(pred, iterable):
               Use a predicate to partition entries into false entries and true entries
               t1, t2 = tee(iterable)
               return filterfalse(pred, t1), filter(pred, t2)
           positional, optional = partition(lambda x: cls.args[x].flags[0].startswith("-"),
           yield from positional
           yield from sorted(optional, key=lambda x: cls.args[x].flags[0])

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:

With regards,
Apache Git Services

View raw message