Skip to content

Commit

Permalink
CLI: Use --when argument by default
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Aug 23, 2023
1 parent 0b4f647 commit 033f736
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and further stops on the trip, and computes travel plan drafts using the [HAFAS]
## Usage

```shell
rex9 travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --on=do-di
rex9 travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --when=do-di
```


Expand Down
4 changes: 2 additions & 2 deletions rex9/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def help_plan():
Synopsis
========
rex9 travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --on=do-di
rex9 travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --when=do-di
"""


Expand All @@ -43,7 +43,7 @@ def cli(ctx: click.Context, verbose: bool, debug: bool):
@click.option("--from", "origin", type=str, required=True)
@click.option("--to", "destination", type=str, required=True)
@click.option("--stops", "stops", type=str, required=False)
@click.option("--on", "when", type=str, required=False)
@click.option("--on", "--when", "when", type=str, required=False)
@click.option("--format", "_format", type=str, required=False, default="markdown")
@click.pass_context
def travel(ctx: click.Context, origin: str, destination: str, stops: str, when: str, _format: str):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_travel_ascii(caplog):

result = runner.invoke(
cli,
args="travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --on=do-di",
args="travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --when=do-di",
catch_exceptions=False,
)
assert result.exit_code == 0
Expand All @@ -38,7 +38,7 @@ def test_travel_html(caplog):

result = runner.invoke(
cli,
args="travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --on=do-di --format=html",
args="travel --from=Oranienburg --to=Stralsund --stops=Fürstenberg,Mildenberg --when=do-di --format=html",
catch_exceptions=False,
)
assert result.exit_code == 0
Expand Down

0 comments on commit 033f736

Please sign in to comment.