diff options
| author | Himanshu Sardana <himanshusardana2005@gmail.com> | 2026-03-25 09:31:54 +0000 |
|---|---|---|
| committer | Himanshu Sardana <himanshusardana2005@gmail.com> | 2026-03-25 09:31:54 +0000 |
| commit | 8056adbc8fd1ec8e4ac165c79f678de3f270e896 (patch) | |
| tree | 7094019143aaed7b0eefa5ba37719b80636c103a /cmd/main.go | |
| parent | af0332e7d805f7a4cb1086b66f61ad706a082768 (diff) | |
refactor: move help message func to internal
Diffstat (limited to 'cmd/main.go')
| -rw-r--r-- | cmd/main.go | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/cmd/main.go b/cmd/main.go index afef7bb..e60dbb7 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "path/filepath" + "strings" internal "github.com/HimanshuSardana/kite/internal/build" ) @@ -53,30 +54,12 @@ func main() { case "build": internal.Build() case "list-themes": - themeList := make([]string, 0) - themes, err := os.ReadDir("../themes/") - if err != nil { - log.Fatal("Error:", err) - } - for _, theme := range themes { - if theme.IsDir() { - themeList = append(themeList, string(theme.Name())) - } - } + themeList := internal.ListThemes() + fmt.Println(strings.Join(themeList, "\n")) default: - showHelpMessage() + internal.ShowHelpMessage() } } else { - showHelpMessage() + internal.ShowHelpMessage() } } - -func showHelpMessage() { - fmt.Println(` -Usage: kite <SUBCOMMAND> - -SUBCOMMANDS: -build -serve -`) -} |
