Skip to content

Commit 9ff7e0e

Browse files
committed
remove repl support
1 parent 282de75 commit 9ff7e0e

File tree

3 files changed

+2
-53
lines changed

3 files changed

+2
-53
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ topicctl repl [flags]
224224
The `repl` subcommand starts up a shell that allows running the `get` and `tail`
225225
subcommands interactively.
226226

227-
By default, `repl` is in read-only mode. Disable this behaviour with: `--read-only-enabled=false`
228-
229227
#### reset-offsets
230228

231229
```

cmd/topicctl/subcmd/repl.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,13 @@ var replCmd = &cobra.Command{
1515
RunE: replRun,
1616
}
1717

18-
type replCmdOptions struct {
19-
readOnly bool
20-
}
21-
2218
type replCmdConfig struct {
23-
options replCmdOptions
24-
shared sharedOptions
19+
shared sharedOptions
2520
}
2621

2722
var replConfig replCmdConfig
2823

2924
func init() {
30-
replCmd.Flags().BoolVar(
31-
&replConfig.options.readOnly,
32-
"read-only-enabled",
33-
true,
34-
"Use read only mode")
35-
3625
addSharedFlags(replCmd, &replConfig.shared)
3726
RootCmd.AddCommand(replCmd)
3827
}
@@ -45,7 +34,7 @@ func replRun(cmd *cobra.Command, args []string) error {
4534
ctx := context.Background()
4635
sess := session.Must(session.NewSession())
4736

48-
adminClient, err := replConfig.shared.getAdminClient(ctx, sess, replConfig.options.readOnly)
37+
adminClient, err := replConfig.shared.getAdminClient(ctx, sess, true)
4938
if err != nil {
5039
return err
5140
}

pkg/cli/repl.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ var (
2424
Text: "get",
2525
Description: "Get information about one or more resources in the cluster",
2626
},
27-
{
28-
Text: "delete",
29-
Description: "Delete a resource in the cluster",
30-
},
3127
{
3228
Text: "tail",
3329
Description: "Tail all messages in a topic",
@@ -42,13 +38,6 @@ var (
4238
},
4339
}
4440

45-
deleteSuggestions = []prompt.Suggest{
46-
{
47-
Text: "topic",
48-
Description: "Delete a single topic",
49-
},
50-
}
51-
5241
getSuggestions = []prompt.Suggest{
5342
{
5443
Text: "acls",
@@ -238,25 +227,6 @@ func (r *Repl) executor(in string) {
238227
case "exit":
239228
fmt.Println("Bye!")
240229
os.Exit(0)
241-
case "delete":
242-
if len(command.args) == 1 {
243-
log.Error("Unrecognized input. Run 'help' for details on available commands.")
244-
return
245-
}
246-
247-
switch command.args[1] {
248-
case "topic":
249-
if err := command.checkArgs(3, 3, nil); err != nil {
250-
log.Errorf("Error: %+v", err)
251-
return
252-
}
253-
254-
topicName := command.args[2]
255-
if err := r.cliRunner.DeleteTopic(ctx, topicName); err != nil {
256-
log.Errorf("Error: %+v", err)
257-
return
258-
}
259-
}
260230
case "get":
261231
if len(command.args) == 1 {
262232
log.Error("Unrecognized input. Run 'help' for details on available commands.")
@@ -469,10 +439,6 @@ func (r *Repl) completer(doc prompt.Document) []prompt.Suggest {
469439
suggestions = commandSuggestions
470440
} else if len(words) == 2 && words[0] == "get" {
471441
suggestions = getSuggestions
472-
} else if len(words) == 2 && words[0] == "delete" {
473-
suggestions = deleteSuggestions
474-
} else if len(words) == 3 && words[0] == "delete" && (words[1] == "topic") {
475-
suggestions = r.topicSuggestions
476442
} else if len(words) == 3 && words[0] == "get" &&
477443
(words[1] == "balance" ||
478444
words[1] == "lags" ||
@@ -560,10 +526,6 @@ func helpTable() string {
560526
" get topics",
561527
"Get all topics",
562528
},
563-
{
564-
" delete topic",
565-
"Deletes a single topic",
566-
},
567529
{
568530
" get users",
569531
"Get all users",

0 commit comments

Comments
 (0)