Skip to content

Commit

Permalink
run: Add -o argument to list realms with stored zuliprc.
Browse files Browse the repository at this point in the history
Tests updated.
  • Loading branch information
Niloth-p committed Jun 22, 2024
1 parent 8800b72 commit 7643361
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/cli/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def test_main_help(capsys: CaptureFixture[str], options: str) -> None:
"--theme THEME, -t THEME",
"-h, --help",
"-d, --debug",
"-o, --list-organizations",
"--list-themes",
"--profile",
"--config-file CONFIG_FILE, -c CONFIG_FILE",
Expand Down
10 changes: 10 additions & 0 deletions zulipterminal/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ def parse_args(argv: List[str]) -> argparse.Namespace:
help="config file downloaded from your zulip "
"organization (default: ~/zuliprc)",
)
parser.add_argument(
"-o",
"--list-organizations",
action="store_true",
help="list all the organizations that you have configurations for, and exit",
)
parser.add_argument(
"--theme",
"-t",
Expand Down Expand Up @@ -530,6 +536,10 @@ def main(options: Optional[List[str]] = None) -> None:
print(f"Zulip Terminal {ZT_VERSION}")
sys.exit(0)

if args.list_organizations:
print(list_realms())
sys.exit(0)

if args.list_themes:
print(list_themes())
sys.exit(0)
Expand Down

0 comments on commit 7643361

Please sign in to comment.