未验证 提交 a9065651 编写于 作者: P Phodal Huang

docs: update help info

上级 5c102bb0
...@@ -10,39 +10,35 @@ Refactoring Modeling: ...@@ -10,39 +10,35 @@ Refactoring Modeling:
![Refactoring Modeling](docs/images/model.svg) ![Refactoring Modeling](docs/images/model.svg)
## Usage features:
install
```bash
go get -u github.com/phodal/coca
``` ```
help:
```bash
Usage:
coca [command]
Available Commands: Available Commands:
analysis analysis package analysis analysis code
api scan api api scan HTTP api from annotation
bs bad smell analysis arch project package visualization
call call graph api bs generate bad smell list and suggestions
cloc cloc [FILE or DIRECTORY] call show call graph with specific method
concept concept api cloc count lines of code with complexity estimation
count count code concept build domain concept from source code
evaluate evaluate refactor effort count count most refs function
git git analysis evaluate evaluate code situation and refactor effort
git analysis git commit history for revs count, summary and suggest
help Help about any command help Help about any command
rcall reverse call rcall reverse call graph visualization
refactor auto refactor code refactor auto refactor code
suggest simple holmes suggest find usable Design Patterns from code
todo scan todo tbs generate tests bad smell
version print the version number of Coca todo scan all todo, and list with time
version version
```
## Usage
install
```bash
go get -u github.com/phodal/coca
``` ```
1. Run `coca analysis` 1. Run `coca analysis`
......
...@@ -19,7 +19,7 @@ var ( ...@@ -19,7 +19,7 @@ var (
var analysisCmd = &cobra.Command{ var analysisCmd = &cobra.Command{
Use: "analysis", Use: "analysis",
Short: "analysis package", Short: "analysis code",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
importPath := analysisCmdConfig.Path importPath := analysisCmdConfig.Path
......
...@@ -39,7 +39,7 @@ var ( ...@@ -39,7 +39,7 @@ var (
var apiCmd = &cobra.Command{ var apiCmd = &cobra.Command{
Use: "api", Use: "api",
Short: "scan api", Short: "scan HTTP api from annotation",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
path := apiCmdConfig.Path path := apiCmdConfig.Path
......
...@@ -23,7 +23,7 @@ var ( ...@@ -23,7 +23,7 @@ var (
var archCmd = &cobra.Command{ var archCmd = &cobra.Command{
Use: "arch", Use: "arch",
Short: "generate arch", Short: "project package visualization",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
identifiers = adapter.LoadIdentify(apiCmdConfig.DependencePath) identifiers = adapter.LoadIdentify(apiCmdConfig.DependencePath)
......
...@@ -19,7 +19,7 @@ var ( ...@@ -19,7 +19,7 @@ var (
var badsmellCmd = &cobra.Command{ var badsmellCmd = &cobra.Command{
Use: "bs", Use: "bs",
Short: "bad smell analysis", Short: "generate bad smell list and suggestions",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
importPath := *&bsCmdConfig.Path importPath := *&bsCmdConfig.Path
......
...@@ -22,7 +22,7 @@ var ( ...@@ -22,7 +22,7 @@ var (
var callGraphCmd = &cobra.Command{ var callGraphCmd = &cobra.Command{
Use: "call", Use: "call",
Short: "call graph api", Short: "show call graph with specific method",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
var parsedDeps []models.JClassNode var parsedDeps []models.JClassNode
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
var clocCmd = &cobra.Command{ var clocCmd = &cobra.Command{
Use: "cloc", Use: "cloc",
Short: "cloc [FILE or DIRECTORY]", Short: "count lines of code with complexity estimation",
Long: fmt.Sprintf("Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation.\nVersion %s\nBen Boyter <ben@boyter.org> + Contributors", processor.Version), Long: fmt.Sprintf("Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation.\nVersion %s\nBen Boyter <ben@boyter.org> + Contributors", processor.Version),
Version: processor.Version, Version: processor.Version,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
......
...@@ -17,7 +17,7 @@ var parsedDeps []models.JClassNode ...@@ -17,7 +17,7 @@ var parsedDeps []models.JClassNode
var conceptCmd = &cobra.Command{ var conceptCmd = &cobra.Command{
Use: "concept", Use: "concept",
Short: "concept api", Short: "build domain concept from source code",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
dependence := cmd.Flag("dependence").Value.String() dependence := cmd.Flag("dependence").Value.String()
......
...@@ -26,7 +26,7 @@ var cparsedDeps []models.JClassNode ...@@ -26,7 +26,7 @@ var cparsedDeps []models.JClassNode
var countCmd = &cobra.Command{ var countCmd = &cobra.Command{
Use: "count", Use: "count",
Short: "count code", Short: "count most refs function",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
dependence := countCmdConfig.DependencePath dependence := countCmdConfig.DependencePath
......
...@@ -24,7 +24,7 @@ var ( ...@@ -24,7 +24,7 @@ var (
var evaluateCmd = &cobra.Command{ var evaluateCmd = &cobra.Command{
Use: "evaluate", Use: "evaluate",
Short: "evaluate refactor effort", Short: "evaluate code situation and refactor effort",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
dependence := *&evaluateConfig.DependencePath dependence := *&evaluateConfig.DependencePath
......
...@@ -27,7 +27,7 @@ var ( ...@@ -27,7 +27,7 @@ var (
var gitCmd = &cobra.Command{ var gitCmd = &cobra.Command{
Use: "git", Use: "git",
Short: "git analysis", Short: "analysis git commit history for revs count, summary and suggest",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
message := getCommitMessage() message := getCommitMessage()
......
...@@ -24,7 +24,7 @@ var ( ...@@ -24,7 +24,7 @@ var (
var reverseCmd = &cobra.Command{ var reverseCmd = &cobra.Command{
Use: "rcall", Use: "rcall",
Short: "reverse call", Short: "reverse call graph visualization",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
dependence := *&reverseConfig.DependencePath dependence := *&reverseConfig.DependencePath
......
...@@ -17,7 +17,7 @@ var ( ...@@ -17,7 +17,7 @@ var (
var suggestCmd = &cobra.Command{ var suggestCmd = &cobra.Command{
Use: "suggest", Use: "suggest",
Short: "simple holmes", Short: "find usable Design Patterns from code",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
parsedDeps = nil parsedDeps = nil
......
...@@ -20,7 +20,7 @@ var ( ...@@ -20,7 +20,7 @@ var (
var tbsCmd = &cobra.Command{ var tbsCmd = &cobra.Command{
Use: "tbs", Use: "tbs",
Short: "test bad smell", Short: "generate tests bad smell",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
files := support.GetJavaTestFiles(tbsCmdConfig.Path) files := support.GetJavaTestFiles(tbsCmdConfig.Path)
......
...@@ -22,7 +22,7 @@ var ( ...@@ -22,7 +22,7 @@ var (
var todoCmd = &cobra.Command{ var todoCmd = &cobra.Command{
Use: "todo", Use: "todo",
Short: "scan todo", Short: "scan all todo, and list with time",
Long: ``, Long: ``,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
path := cmd.Flag("path").Value.String() path := cmd.Flag("path").Value.String()
......
...@@ -12,7 +12,7 @@ func init() { ...@@ -12,7 +12,7 @@ func init() {
var versionCmd = &cobra.Command{ var versionCmd = &cobra.Command{
Use: "version", Use: "version",
Short: "print the version number of Coca", Short: "version",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Coca Version: " + config.VERSION + " -- HEAD") fmt.Println("Coca Version: " + config.VERSION + " -- HEAD")
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册