Skip to content

Conversation

@alnr
Copy link
Collaborator

@alnr alnr commented Jan 12, 2024

@alnr alnr self-assigned this Jan 12, 2024

func NewCreateEventStreamCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "event-stream [--project=PROJECT_ID] --type=sns --aws-iam-role-arn=arn:aws:iam::123456789012:role/MyRole --aws-sns-topic-arn=arn:aws:sns:us-east-1:123456789012:MyTopic",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a flag is required, shouldn't it be a positional argument instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a rule? Considering you need to provide a bunch of info, that’d get complicated real quick.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a rule, just feels weird to have required flags in a CLI application. But I agree, the values are probably too convoluted to make them positional arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to weigh in with my anecdotal opinion, I like flags here because they are more documenting that just a huge list of positional arguments.

Copy link
Contributor

@hperl hperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alnr alnr merged commit 2da4f08 into master Jan 18, 2024
@alnr alnr deleted the event-streams branch January 18, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants