fix: set variables and flag for message

pull/36/head
kha7iq 4 years ago
parent a4146c8a79
commit 36a6d8abbd

@ -85,33 +85,30 @@ You can specify multiple userIds by separating the value with ','.`,
Destination: &zulipOpts.Type, Destination: &zulipOpts.Type,
Name: "type", Name: "type",
Aliases: []string{}, Aliases: []string{},
Required: true,
Usage: "The type of message to be sent. private for a private message and stream for a stream message.", 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{ &cli.StringFlag{
Destination: &zulipOpts.To, Destination: &zulipOpts.To,
Name: "to", Name: "to",
Aliases: []string{}, Aliases: []string{},
Required: true,
Usage: "For stream messages, the name of the stream. For private messages, csv of email addresses", 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{ &cli.StringFlag{
Destination: &zulipOpts.Topic, Destination: &zulipOpts.Topic,
Name: "topic", Name: "topic",
Aliases: []string{}, Aliases: []string{},
Required: true, Usage: "The topic of the message. Only required for stream messages 'type=stream', ignored otherwise.",
Usage: "The topic of the message. Only required for stream messages (type=\"stream\"), ignored otherwise.", EnvVars: []string{"ZULIP_TOPIC"},
EnvVars: []string{},
}, },
&cli.StringFlag{ &cli.StringFlag{
Destination: &zulipOpts.Content, Destination: &zulipOpts.Content,
Name: "content", Name: "msg",
Aliases: []string{}, Aliases: []string{},
Required: true, Required: true,
Usage: "The content of the message.", Usage: "The content of the message.",
EnvVars: []string{}, EnvVars: []string{"ZULIP_MESSAGE"},
}, },
}, },
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {

Loading…
Cancel
Save