forked from ribice/glice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3705d0
commit c425f38
Showing
55 changed files
with
3,804 additions
and
842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.idea/ | ||
licenses/ | ||
* | ||
!*.* | ||
!*/ | ||
.DS_Store | ||
.idea/* | ||
.idea/** | ||
bin/** | ||
test/log/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ builds: | |
- linux | ||
goarch: | ||
- amd64 | ||
- 386 | ||
- "386" | ||
ldflags: | ||
- -s -w | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This is the directory where v2 main.go was. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/ribice/glice/v3/pkg" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// initCmd represents the init command | ||
var initCmd = &cobra.Command{ | ||
Use: "init", | ||
Run: glice.RunInit, | ||
Short: "Initialize a 'glice.yaml' command in your project's path", | ||
Long: `Initialize a 'glice.yaml' command in your project's path. ` + | ||
`'init' will scan the go.mod file for dependencies and write ` + | ||
`them to the YAML file which can then be hand-edited to add ` + | ||
`overrides. Optionally it can generate a cache-file to allow ` + | ||
`future invocations of the 'scan' command to assume data to ` + | ||
`be current if last scanned within a specifiable TTL (time-to-live.)`, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(initCmd) | ||
initCmd.Flags().String("cache-file", glice.CacheFilepath(), "Full filepath for cache file to create") | ||
initCmd.Flags().String("path", glice.SourceDir(""), "Directory path to your project's top-level go.mod file") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// printCmd represents the print command | ||
var printCmd = &cobra.Command{ | ||
Use: "print", | ||
Short: "A brief description of your command", | ||
Long: `A longer description that spans multiple lines and likely contains examples | ||
and usage of using your command. For example: | ||
Cobra is a CLI library for Go that empowers applications. | ||
This application is a tool to generate the needed files | ||
to quickly create a Cobra application.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("print called") | ||
}, | ||
} | ||
|
||
func init() { | ||
reportCmd.AddCommand(printCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// printCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
// printCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
} |
Oops, something went wrong.