Merge pull request #47 from CarlJi/0627

doc: be consistent and remove noise
This commit is contained in:
Changjun Ji 2020-06-27 13:28:26 +08:00 committed by GitHub
commit da04bb484c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 7 deletions

View File

@ -34,7 +34,7 @@ Build command will copy the project code and its necessary dependencies to a tem
`, `,
Example: ` Example: `
# Build the current binary with cover variables injected. The binary will be generated in the current folder. # Build the current binary with cover variables injected. The binary will be generated in the current folder.
goc build goc build .
# Build the current binary with cover variables injected, and set the registry center to http://127.0.0.1:7777. # Build the current binary with cover variables injected, and set the registry center to http://127.0.0.1:7777.
goc build --center=http://127.0.0.1:7777 goc build --center=http://127.0.0.1:7777

View File

@ -11,8 +11,6 @@ var (
mode string mode string
debugGoc bool debugGoc bool
buildFlags string buildFlags string
// packages string
appArgs string
goRunExecFlag string goRunExecFlag string
goRunArguments string goRunArguments string
@ -41,7 +39,6 @@ func addBuildFlags(cmdset *pflag.FlagSet) {
func addRunFlags(cmdset *pflag.FlagSet) { func addRunFlags(cmdset *pflag.FlagSet) {
addBuildFlags(cmdset) addBuildFlags(cmdset)
cmdset.StringVar(&appArgs, "appargs", "", "specify the application's arguments")
cmdset.StringVar(&goRunExecFlag, "exec", "", "same as -exec flag in 'go run' command") cmdset.StringVar(&goRunExecFlag, "exec", "", "same as -exec flag in 'go run' command")
cmdset.StringVar(&goRunArguments, "arguments", "", "same as 'arguments' in 'go run' command") cmdset.StringVar(&goRunArguments, "arguments", "", "same as 'arguments' in 'go run' command")
// bind to viper // bind to viper

View File

@ -33,7 +33,7 @@ Install command will copy the project code and its necessary dependencies to a t
`, `,
Example: ` Example: `
# Install all binaries with cover variables injected. The binary will be installed in $GOPATH/bin or $HOME/go/bin if directory existed. # Install all binaries with cover variables injected. The binary will be installed in $GOPATH/bin or $HOME/go/bin if directory existed.
goc install --packages="./..." goc install ./...
# Install the current binary with cover variables injected, and set the registry center to http://127.0.0.1:7777. # Install the current binary with cover variables injected, and set the registry center to http://127.0.0.1:7777.
goc install --center=http://127.0.0.1:7777 goc install --center=http://127.0.0.1:7777

View File

@ -33,8 +33,9 @@ var runCmd = &cobra.Command{
Short: "Run covers and runs the named main Go package", Short: "Run covers and runs the named main Go package",
Long: `Run covers and runs the named main Go package, Long: `Run covers and runs the named main Go package,
It is exactly behave as 'go run .' in addition of some internal goc features.`, It is exactly behave as 'go run .' in addition of some internal goc features.`,
Example: ` Example: `
goc run . goc run .
goc run . [--buildflags] [--exec] [--arguments]
`, `,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
wd, err := os.Getwd() wd, err := os.Getwd()

View File

@ -165,7 +165,7 @@ func (c *PrComment) GetPrChangedFiles() (files []string, err error) {
func GenCommentContent(commentPrefix string, delta cover.DeltaCovList) string { func GenCommentContent(commentPrefix string, delta cover.DeltaCovList) string {
var buf bytes.Buffer var buf bytes.Buffer
table := tablewriter.NewWriter(&buf) table := tablewriter.NewWriter(&buf)
table.SetHeader([]string{"File", "BASE Coverage", "New Coverage", "Delta"}) table.SetHeader([]string{"File", "Base Coverage", "New Coverage", "Delta"})
table.SetAutoFormatHeaders(false) table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetCenterSeparator("|") table.SetCenterSeparator("|")