Skip to content

Commit

Permalink
feat(cmd): add new command and improve lookpath output
Browse files Browse the repository at this point in the history
- Add new.go file to implement 'new' command functionality
- Update main.go to include 'new' command in rootCmd
- Modify lookpath output in new.go for better visibility
  • Loading branch information
godcong committed Nov 22, 2024
1 parent cc88198 commit ea04dd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/new.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"fmt"
"os/exec"

"github.com/spf13/cobra"
Expand All @@ -15,6 +16,8 @@ func NewCmd() *cobra.Command {
if err != nil {
return err
}
fmt.Println("lookpath:", path)
return nil
},
}
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func init() {
rootCmd.CompletionOptions.HiddenDefaultCmd = true
rootCmd.CompletionOptions.DisableNoDescFlag = true
// rootCmd.SetUsageTemplate(resources.Usage)
rootCmd.AddCommand(cmd.InitCmd())
rootCmd.AddCommand(cmd.InitCmd(), cmd.NewCmd())
rootCmd.Version = goinfo.String()
}

Expand Down

0 comments on commit ea04dd3

Please sign in to comment.