From 6e77947b7aa90aed233bf7f04d4b1cfb80ec428d Mon Sep 17 00:00:00 2001 From: Eric Bower Date: Mon, 7 Oct 2024 21:54:36 -0400 Subject: [PATCH] chore(pubsub): print `-p` flag for pub and pipe stdout msg --- pubsub/cli.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pubsub/cli.go b/pubsub/cli.go index c6c859cd..bccaca25 100644 --- a/pubsub/cli.go +++ b/pubsub/cli.go @@ -256,6 +256,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware { } var name string + msgFlag := "" if isAdmin && strings.HasPrefix(topic, "/") { name = strings.TrimPrefix(topic, "/") @@ -263,13 +264,15 @@ func WishMiddleware(handler *CliHandler) wish.Middleware { name = toTopic(user.Name, topic) if *public { name = toPublicTopic(topic) + msgFlag = "-p " } } wish.Printf( sesh, - "subscribe to this channel:\n\tssh %s sub %s\n", + "subscribe to this channel:\n\tssh %s sub %s%s\n", toSshCmd(handler.Cfg), + msgFlag, topic, ) @@ -423,6 +426,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware { } var name string + flagMsg := "" if isAdmin && strings.HasPrefix(topic, "/") { name = strings.TrimPrefix(topic, "/") @@ -430,14 +434,16 @@ func WishMiddleware(handler *CliHandler) wish.Middleware { name = toTopic(user.Name, topic) if *public { name = toPublicTopic(topic) + flagMsg = "-p " } } if isCreator { wish.Printf( sesh, - "subscribe to this topic:\n\tssh %s sub %s\n", + "subscribe to this topic:\n\tssh %s sub %s%s\n", toSshCmd(handler.Cfg), + flagMsg, topic, ) }