From fbefa1bad0acb00cff1fc10727056cc6491f4ad9 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Tue, 17 Dec 2019 07:25:51 +0800 Subject: [PATCH] feat: make to json --- README.md | 10 ++++++++-- cmd/cloc.go | 4 ++-- .../MomaHFBWg-Code-Complexity-by-files.feature | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 stories/MomaHFBWg-Code-Complexity-by-files.feature diff --git a/README.md b/README.md index 0e1eb39..be3241c 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Available Commands: ga git analysis help Help about any command refactor auto refactor code - scc scc [FILE or DIRECTORY] + cloc cloc [FILE or DIRECTORY] ``` @@ -65,7 +65,7 @@ Examples Result: ### Code Line Count ``` -coca scc +coca cloc ``` Results: @@ -94,6 +94,12 @@ Estimated People Required 6.743156 ───────────────────────────────────────────────────────────────────────────────s ``` +Results to json + +``` +coca cloc --by-file --format json +``` + ### Build Deps Tree ``` diff --git a/cmd/cloc.go b/cmd/cloc.go index 64191e1..af72641 100644 --- a/cmd/cloc.go +++ b/cmd/cloc.go @@ -7,8 +7,8 @@ import ( ) var clocCmd = &cobra.Command{ - Use: "scc", - Short: "scc [FILE or DIRECTORY]", + Use: "cloc", + Short: "cloc [FILE or DIRECTORY]", Long: fmt.Sprintf("Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation.\nVersion %s\nBen Boyter + Contributors", processor.Version), Version: processor.Version, Run: func(cmd *cobra.Command, args []string) { diff --git a/stories/MomaHFBWg-Code-Complexity-by-files.feature b/stories/MomaHFBWg-Code-Complexity-by-files.feature new file mode 100644 index 0000000..3c2d13c --- /dev/null +++ b/stories/MomaHFBWg-Code-Complexity-by-files.feature @@ -0,0 +1,16 @@ +# id: MomaHFBWg +# startDate: 2019-12-16T23:22:44Z +# endDate: 2019-12-16T23:22:44Z +# priority: +# status: +# author: +# title: Code Complexity by files +# language: zh-CN +@math +功能:Code Complexity by files + + 场景: + 假设: + 当: + 并且: + 那么: -- GitLab