Skip to content

Commit a56fcf5

Browse files
committed
chore: remove unused const
1 parent a32826d commit a56fcf5

2 files changed

Lines changed: 10 additions & 28 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
1818
github.com/sourcegraph/go-lsp v0.0.0-20240223163137-f80c5dd31dfd
1919
github.com/sourcegraph/jsonrpc2 v0.2.0
20+
github.com/spf13/cobra v1.8.1
2021
github.com/stretchr/testify v1.10.0
2122
github.com/vifraa/gopom v1.0.0
2223
golang.org/x/mod v0.24.0
@@ -76,7 +77,6 @@ require (
7677
github.com/sirupsen/logrus v1.9.3 // indirect
7778
github.com/slongfield/pyfmt v0.0.0-20220222012616-ea85ff4c361f // indirect
7879
github.com/spf13/cast v1.7.1 // indirect
79-
github.com/spf13/cobra v1.8.1 // indirect
8080
github.com/spf13/pflag v1.0.5 // indirect
8181
github.com/tidwall/gjson v1.18.0 // indirect
8282
github.com/tidwall/match v1.1.1 // indirect

main.go

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"path/filepath"
3939
"strings"
4040

41-
"github.com/spf13/cobra"
4241
interutils "github.com/cloudwego/abcoder/internal/utils"
4342
"github.com/cloudwego/abcoder/lang"
4443
"github.com/cloudwego/abcoder/lang/log"
@@ -49,26 +48,9 @@ import (
4948
"github.com/cloudwego/abcoder/llm/mcp"
5049
"github.com/cloudwego/abcoder/llm/tool"
5150
"github.com/cloudwego/abcoder/version"
51+
"github.com/spf13/cobra"
5252
)
5353

54-
const Usage = `abcoder <Action> [Language] <Path> [Flags]
55-
Action:
56-
parse parse the specific repo and write its UniAST (to stdout by default)
57-
write write the specific UniAST back to codes
58-
mcp run as a MCP server for all repo ASTs (*.json) in the specific directory
59-
agent run as an Agent for all repo ASTs (*.json) in the specific directory. WIP: only support code-analyzing at present.
60-
init-spec initialize ABCoder integration for Claude Code (copies .claude directory and configures MCP servers)
61-
version print the version of abcoder
62-
Language:
63-
go for golang codes
64-
rust for rust codes
65-
cxx for c codes (cpp support is on the way)
66-
python for python codes
67-
ts for typescript codes
68-
js for javascript codes
69-
java for java codes
70-
`
71-
7254
func main() {
7355
cmd := NewRootCmd()
7456
if err := cmd.Execute(); err != nil {
@@ -115,10 +97,10 @@ Use this command to verify installation or when reporting issues.`,
11597

11698
func newParseCmd() *cobra.Command {
11799
var (
118-
flagOutput string
119-
flagLsp string
120-
javaHome string
121-
opts lang.ParseOptions
100+
flagOutput string
101+
flagLsp string
102+
javaHome string
103+
opts lang.ParseOptions
122104
)
123105

124106
cmd := &cobra.Command{
@@ -137,7 +119,7 @@ Language Support:
137119
js - JavaScript projects
138120
java - Java projects`,
139121
Example: `abcoder parse go ./my-project -o ast.json`,
140-
Args: cobra.ExactArgs(2),
122+
Args: cobra.ExactArgs(2),
141123
PreRunE: func(cmd *cobra.Command, args []string) error {
142124
// Validate language
143125
language := uniast.NewLanguage(args[0])
@@ -271,7 +253,7 @@ The server communicates via stdio and can be integrated with Claude Code or othe
271253
272254
It serves all *.json AST files in the specified directory.`,
273255
Example: `abcoder mcp ./asts/`,
274-
Args: cobra.ExactArgs(1),
256+
Args: cobra.ExactArgs(1),
275257
PreRunE: func(cmd *cobra.Command, args []string) error {
276258
if args[0] == "" {
277259
return fmt.Errorf("argument Path is required")
@@ -315,7 +297,7 @@ The command will:
315297
1. Copy the .claude configuration directory
316298
2. Configure MCP server settings in Claude's config.json`,
317299
Example: `abcoder init-spec /path/to/project`,
318-
Args: cobra.MaximumNArgs(1),
300+
Args: cobra.MaximumNArgs(1),
319301
RunE: func(cmd *cobra.Command, args []string) error {
320302
verbose, _ := cmd.Flags().GetBool("verbose")
321303
if verbose {
@@ -364,7 +346,7 @@ Examples:
364346
# With custom API endpoint and step limit
365347
API_TYPE=custom API_KEY=xxx MODEL_NAME=my-model BASE_URL=https://api.example.com \
366348
abcoder agent ./asts/ --agent-max-steps 100`,
367-
Args: cobra.ExactArgs(1),
349+
Args: cobra.ExactArgs(1),
368350
PreRunE: func(cmd *cobra.Command, args []string) error {
369351
if args[0] == "" {
370352
return fmt.Errorf("argument Path is required")

0 commit comments

Comments
 (0)