From 36a6d8abbd96d04976096dfd40e781fed368489a Mon Sep 17 00:00:00 2001 From: kha7iq Date: Thu, 20 May 2021 13:54:55 +0800 Subject: [PATCH] fix: set variables and flag for message --- service/zulip/zulip.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/service/zulip/zulip.go b/service/zulip/zulip.go index 87a20ef..9bbe09f 100644 --- a/service/zulip/zulip.go +++ b/service/zulip/zulip.go @@ -85,33 +85,30 @@ You can specify multiple userIds by separating the value with ','.`, Destination: &zulipOpts.Type, Name: "type", Aliases: []string{}, - Required: true, Usage: "The type of message to be sent. private for a private message and stream for a stream message.", - EnvVars: []string{}, + EnvVars: []string{"ZULIP_MSG_TYPE"}, }, &cli.StringFlag{ Destination: &zulipOpts.To, Name: "to", Aliases: []string{}, - Required: true, Usage: "For stream messages, the name of the stream. For private messages, csv of email addresses", - EnvVars: []string{}, + EnvVars: []string{"ZULIP_STREAM_NAME"}, }, &cli.StringFlag{ Destination: &zulipOpts.Topic, Name: "topic", Aliases: []string{}, - Required: true, - Usage: "The topic of the message. Only required for stream messages (type=\"stream\"), ignored otherwise.", - EnvVars: []string{}, + Usage: "The topic of the message. Only required for stream messages 'type=stream', ignored otherwise.", + EnvVars: []string{"ZULIP_TOPIC"}, }, &cli.StringFlag{ Destination: &zulipOpts.Content, - Name: "content", + Name: "msg", Aliases: []string{}, Required: true, Usage: "The content of the message.", - EnvVars: []string{}, + EnvVars: []string{"ZULIP_MESSAGE"}, }, }, Action: func(ctx *cli.Context) error {