add commands to start tui and web
This commit is contained in:
@@ -104,6 +104,8 @@ func init() {
|
|||||||
RootCmd.AddGroup(&cobra.Group{ID: "other", Title: "Additional Commands"})
|
RootCmd.AddGroup(&cobra.Group{ID: "other", Title: "Additional Commands"})
|
||||||
RootCmd.SetHelpCommandGroupID("other")
|
RootCmd.SetHelpCommandGroupID("other")
|
||||||
RootCmd.AddCommand(replCmd)
|
RootCmd.AddCommand(replCmd)
|
||||||
|
RootCmd.AddCommand(tuiCmd)
|
||||||
|
RootCmd.AddCommand(webCmd)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +119,26 @@ var replCmd = &cobra.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tuiCmd = &cobra.Command{
|
||||||
|
Use: "tui",
|
||||||
|
GroupID: "other",
|
||||||
|
Short: "Start the interactive TUI interface",
|
||||||
|
Long: `Start the interactive Terminal User Interface (TUI) for managing your projects and issues in an interactive terminal environment.`,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return tui.New().Run(cmd.Context(), App.Config)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var webCmd = &cobra.Command{
|
||||||
|
Use: "web",
|
||||||
|
GroupID: "other",
|
||||||
|
Short: "Start the interactive web interface",
|
||||||
|
Long: `Start the interactive web interface for managing your projects and issues in a web browser.`,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return web.New().Run(cmd.Context(), App.Config)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
func initializeApp(ctx context.Context) (*app.App, func(), error) {
|
func initializeApp(ctx context.Context) (*app.App, func(), error) {
|
||||||
return app.New(ctx, tasks.BaseConfig().WithAutoInit(true))
|
return app.New(ctx, tasks.BaseConfig().WithAutoInit(true))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user