You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Josh Carp (JIRA)" <ji...@apache.org> on 2019/03/02 20:21:00 UTC

[jira] [Created] (AIRFLOW-3998) Use nested commands in cli

Josh Carp created AIRFLOW-3998:
----------------------------------

             Summary: Use nested commands in cli
                 Key: AIRFLOW-3998
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3998
             Project: Apache Airflow
          Issue Type: Improvement
            Reporter: Josh Carp
            Assignee: Josh Carp


From https://lists.apache.org/thread.html/94c97ed621706a2e9130a3550b879a5838c23209f2d6d40f8bb49cd8@%3Cdev.airflow.apache.org%3E:

 

The CLI treats `airflow connection` as a single command, with `--list`, `--add`, etc. as flags. This means it's possible to pass options that can't be used together: passing `--list` with `--conn_id` should be invalid. The current implementation has to handle validation of mutually exclusive options separately for each command. I think the code would be simpler and easier to use if we used nested commands instead of flags: `airflow connections list` and `airflow connections add` would be separate subcommands that would take different arguments, and we wouldn't have to check for invalid combinations of commands and arguments.

 

I'll file a proof of concept patch refactoring the `airflow connections` command for discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)