Skip to content
11 changes: 11 additions & 0 deletions novem/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from novem import Grid, Job, Mail, Plot
from novem.api_ref import Novem404, NovemAPI
from novem.cli.editor import edit
from novem.cli.gql import NovemGQL, fetch_topics_gql, render_topics
from novem.cli.setup import Share, Tag
from novem.cli.vis import (
list_job_shares,
Expand Down Expand Up @@ -149,6 +150,16 @@ def __call__(self, args: Dict[str, Any]) -> None:
print(ts)
return

# --comments: show topics and comment threads
if args.get("comments"):
if "profile" in args and args["profile"]:
args["config_profile"] = args["profile"]
gql = NovemGQL(**args)
topics = fetch_topics_gql(gql, self.fragment, name, author=usr)
me = gql._config.get("username", "")
print(render_topics(topics, me=me))
return

# if we have the -e or edit flag then this takes presedence over all other
# inputs
if "edit" in args and args["edit"]:
Expand Down
Loading