Skip to content

Commit 376f8df

Browse files
committed
'$ bob init' as hidden alias of '$ bob tools init'
1 parent 581ec19 commit 376f8df

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cmd/bob/init.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ func writeBobfileIfNotExists(content Bobfile) error {
137137
}
138138

139139
func initEntry() *cobra.Command {
140+
return initEntryWithHidden(false)
141+
}
142+
143+
func initEntryWithHidden(hidden bool) *cobra.Command {
140144
github := false
141145
gitLab := false
142146
docker := false
143147

144148
cmd := &cobra.Command{
145-
Use: "init",
146-
Short: "Initializes this project with a default turbobob.json",
147-
Args: cobra.NoArgs,
149+
Use: "init",
150+
Short: "Initializes this project with a default turbobob.json",
151+
Args: cobra.NoArgs,
152+
Hidden: hidden,
148153
Run: func(cmd *cobra.Command, args []string) {
149154
if github {
150155
osutil.ExitIfError(writeGitHubActionsBoilerplate())

cmd/bob/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func main() {
5353

5454
app.AddCommand(openProjectHomepageEntrypoint())
5555

56+
// hidden "$ bob init" for convenience (it exists as non-hidden under tools)
57+
app.AddCommand(initEntryWithHidden(true))
58+
5659
app.AddCommand(toolsEntry()) // namespace for less often needed tools
5760
} else {
5861
app.AddCommand(buildInsideEntry())

0 commit comments

Comments
 (0)