From d393ea9b45d97087fa37710091208afd88be5f1f Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sat, 14 Dec 2019 23:12:58 +0800 Subject: [PATCH] docs: update docs --- README.md | 25 +++++++++++++++++++++++++ cmd/api.go | 4 ++-- cmd/root.go | 9 --------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d6f51b6..d761476 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,24 @@ install go get https://github.com/phodal/coca ``` + +help: + +``` +Usage: + coca [command] + +Available Commands: + analysis analysis package + api scan api + call call graph api + concept concept api + help Help about any command + refactor auto refactor code + +``` + + Analysis ``` @@ -53,3 +71,10 @@ go get github.com/onsi/gomega ### Refs [https://github.com/MontFerret/ferret](https://github.com/MontFerret/ferret) + +License +--- + +[![Phodal's Idea](http://brand.phodal.com/shields/idea-small.svg)](http://ideas.phodal.com/) + +@ 2019 A [Phodal Huang](https://www.phodal.com)'s [Idea](http://github.com/phodal/ideas). This code is distributed under the MIT license. See `LICENSE` in this directory. diff --git a/cmd/api.go b/cmd/api.go index f1933e4..bb5b146 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -28,6 +28,6 @@ var apiCmd *cobra.Command = &cobra.Command{ func init() { rootCmd.AddCommand(apiCmd) - rootCmd.PersistentFlags().StringP("path", "p", "", "path") - rootCmd.PersistentFlags().StringP("dependence", "d", "", "get dependence file") + apiCmd.PersistentFlags().StringP("path", "p", "", "path") + apiCmd.PersistentFlags().StringP("dependence", "d", "", "get dependence file") } diff --git a/cmd/root.go b/cmd/root.go index dd23a52..5c2c643 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,9 +5,6 @@ import ( ) var ( - // Used for flags. - cfgFile string - rootCmd = &cobra.Command{ Use: "coca", Short: "A generator for Cobra based Applications", @@ -19,9 +16,3 @@ func Execute() error { return rootCmd.Execute() } -func init() { - rootCmd.AddCommand(analysisCmd) - - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") -} - -- GitLab