Unify command names in CLI (#10720)
* Unify command names in CLI * fixup! Unify command names in CLI
This commit is contained in:
Родитель
6f96e81f01
Коммит
ab5235ee12
|
@ -235,6 +235,7 @@ you have to run the help command: ``airflow celery --help``.
|
|||
| ``airflow list_dag_runs`` | ``airflow dags list-runs`` | ``dags`` |
|
||||
| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
|
||||
| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
|
||||
| ``airflow next_execution`` | ``airflow dags next-execution`` | ``dags`` |
|
||||
| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
|
||||
| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
|
||||
| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
|
||||
|
|
|
@ -810,7 +810,7 @@ DAGS_COMMANDS = (
|
|||
args=(ARG_DAG_ID, ARG_EXECUTION_DATE, ARG_SUBDIR),
|
||||
),
|
||||
ActionCommand(
|
||||
name='next_execution',
|
||||
name='next-execution',
|
||||
help="Get the next execution datetimes of a DAG",
|
||||
description=(
|
||||
"Get the next execution datetimes of a DAG. It returns one execution unless the "
|
||||
|
|
|
@ -271,7 +271,7 @@ def dag_state(args):
|
|||
def dag_next_execution(args):
|
||||
"""
|
||||
Returns the next execution datetime of a DAG at the command line.
|
||||
>>> airflow dags next_execution tutorial
|
||||
>>> airflow dags next-execution tutorial
|
||||
2018-08-31 10:38:00
|
||||
"""
|
||||
dag = get_dag(args.subdir, args.dag_id)
|
||||
|
|
|
@ -257,7 +257,7 @@ class TestCliDags(unittest.TestCase):
|
|||
|
||||
# Test None output
|
||||
args = self.parser.parse_args(['dags',
|
||||
'next_execution',
|
||||
'next-execution',
|
||||
dag_ids[0]])
|
||||
with contextlib.redirect_stdout(io.StringIO()) as temp_stdout:
|
||||
dag_command.dag_next_execution(args)
|
||||
|
@ -289,7 +289,7 @@ class TestCliDags(unittest.TestCase):
|
|||
|
||||
# Test num-executions = 1 (default)
|
||||
args = self.parser.parse_args(['dags',
|
||||
'next_execution',
|
||||
'next-execution',
|
||||
dag_id])
|
||||
with contextlib.redirect_stdout(io.StringIO()) as temp_stdout:
|
||||
dag_command.dag_next_execution(args)
|
||||
|
@ -298,7 +298,7 @@ class TestCliDags(unittest.TestCase):
|
|||
|
||||
# Test num-executions = 2
|
||||
args = self.parser.parse_args(['dags',
|
||||
'next_execution',
|
||||
'next-execution',
|
||||
dag_id,
|
||||
'--num-executions',
|
||||
'2'])
|
||||
|
|
Загрузка…
Ссылка в новой задаче