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.

This might overlap with other CLI refactoring, like 
https://issues.apache.org/jira/browse/AIRFLOW-3358. I'm not sure if that 
conversation is still active, though.

Interested to get feedback about this--maybe there are advantages to using 
flags instead of subcommands that I haven't thought of.

Reply via email to