Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In is_running(), list CLI commands generically #411

Merged
merged 2 commits into from Apr 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions flexmeasures/cli/__init__.py
Expand Up @@ -29,9 +29,8 @@ def is_running() -> bool:

See also: the run_as_cli test fixture, which uses the (non-public) PRETEND_RUNNING_AS_CLI env setting.

TODO: How can plugins add their CLI set here, should they need that?
"""
cli_sets = ("add", "delete", "show", "monitor", "jobs", "db-ops")
cli_sets = current_app.cli.list_commands(ctx=None)
command_line = " ".join(sys.argv)
for cli_set in cli_sets:
if f"flexmeasures {cli_set}" in command_line:
Expand Down