-
Notifications
You must be signed in to change notification settings - Fork 23
[source-kafka] Fix subcommand's long, short, Use values and update docs #65
Conversation
return sourceCmd | ||
} | ||
|
||
func (f *kafkaSourceCommandFactory) CreateCommand() *cobra.Command { | ||
createCmd := f.defaultCommandFactory.CreateCommand() | ||
createCmd.Short = "create NAME" | ||
createCmd.Use = "create NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should represent all the flags which are mandatory for creating a kafka source
(check ping source usage string for example where --sink
is a mandatory option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
describeCmd.Short = "describe NAME" | ||
describeCmd.Long = "update a Kafka source" | ||
describeCmd.Use = "describe NAME" | ||
describeCmd.Short = "update a Kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describeCmd.Short = "update a Kafka source" | |
describeCmd.Short = "Describe a Kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
deleteCmd.Short = "delete NAME" | ||
deleteCmd.Long = "delete a Kafka source" | ||
deleteCmd.Use = "delete NAME" | ||
deleteCmd.Short = "delete a Kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteCmd.Short = "delete a Kafka source" | |
deleteCmd.Short = "Delete a kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
return sourceCmd | ||
} | ||
|
||
func (f *kafkaSourceCommandFactory) CreateCommand() *cobra.Command { | ||
createCmd := f.defaultCommandFactory.CreateCommand() | ||
createCmd.Short = "create NAME" | ||
createCmd.Use = "create NAME" | ||
createCmd.Short = "create a kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createCmd.Short = "create a kafka source" | |
createCmd.Short = "Create a kafka source" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
return sourceCmd | ||
} | ||
|
||
func (f *kafkaSourceCommandFactory) CreateCommand() *cobra.Command { | ||
createCmd := f.defaultCommandFactory.CreateCommand() | ||
createCmd.Short = "create NAME" | ||
createCmd.Use = "create NAME --sink SINK" | ||
createCmd.Short = "Create a kafka source" | ||
createCmd.Example = `#Creates a new Kafka source named as 'mykafkasrc' which subscribes a Kafka server 'my-cluster-kafka-bootstrap.kafka.svc:9092' at topic 'test-topic' using the consumer group ID 'test-consumer-group' and sends the event messages to service 'event-display' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a space between #
and the example description? I just found kn
command has space between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thank you.
plugins/source-kafka/README.md
Outdated
* [kafka create](#kafka-create) - Create a kafka source | ||
* [kafka delete](#kafka-delete) - Delete a Kafka source | ||
* [kafka describe](#kafka-describe) - Describe a Kafka source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent spell for "kafka", should begin with lower case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
plugins/source-kafka/README.md
Outdated
|
||
``` | ||
kafka create NAME [flags] | ||
kafka create NAME --sink SINK [flags] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the flags except sink are required for kafka source creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, usage should also include being with kn source
, i.e.
kn source kafka create NAME --servers SERVERS --topics TOPICS --consumergroup GROUP [options]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added all flags to the usage output.
As to add kn source
to the usage, it's not easy to fix here. This part of README.md is auto generated by cobra/doc
. I could try to change my doc generator tool to add kn source
in front of command usage. Let's keep it as it in this PR. I will create a new issue.
plugins/source-kafka/README.md
Outdated
``` | ||
|
||
#### Examples | ||
|
||
``` | ||
#Creates a new Kafka source named as 'mykafkasrc' which subscribes a Kafka server 'my-cluster-kafka-bootstrap.kafka.svc:9092' at topic 'test-topic' using the consumer group ID 'test-consumer-group' and sends the event messages to service 'event-display' | ||
# Creates a new Kafka source named as 'mykafkasrc' which subscribes a Kafka server 'my-cluster-kafka-bootstrap.kafka.svc:9092' at topic 'test-topic' using the consumer group ID 'test-consumer-group' and sends the event messages to service 'event-display' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Creates a new Kafka source named as 'mykafkasrc' which subscribes a Kafka server 'my-cluster-kafka-bootstrap.kafka.svc:9092' at topic 'test-topic' using the consumer group ID 'test-consumer-group' and sends the event messages to service 'event-display' | |
# Create a new Kafka source 'mykafkasrc' which subscribes a Kafka server 'my-cluster-kafka-bootstrap.kafka.svc:9092' at topic 'test-topic' using the consumer group ID 'test-consumer-group' and sends the events to service 'event-display' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. Thank you.
describeCmd.Example = `#Describes a Kafka source with NAME | ||
describeCmd.Use = "describe NAME" | ||
describeCmd.Short = "Describe a Kafka source" | ||
describeCmd.Example = `# Describes a Kafka source with NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describeCmd.Example = `# Describes a Kafka source with NAME | |
describeCmd.Example = `# Describe a Kafka source with NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix the kn-source-pkg
to match some of these Cobra.Long
, Cobra.Short
, Cobra.Use` usages
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daisy-ycguo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes still needed.
plugins/source-kafka/README.md
Outdated
* [kafka delete](#kafka-delete) - delete NAME | ||
* [kafka describe](#kafka-describe) - describe NAME | ||
* [kafka create](#kafka-create) - Create a kafka source | ||
* [kafka delete](#kafka-delete) - Delete a Kafka source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but still seeing "Delete a Kafka source" which is not consistent with the "kafka" spelling. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change all command output to lower case, except the first word of a sentence.
plugins/source-kafka/README.md
Outdated
@@ -94,11 +94,11 @@ kn source kafka create mykafkasrc --servers my-cluster-kafka-bootstrap.kafka.svc | |||
|
|||
### kafka delete | |||
|
|||
delete NAME | |||
Delete a Kafka source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change all command output to lower case, except the first word of a sentence.
/lgtm |
Closes #59