Merge Go frontend (apiserver + xcecli) into meson build
This commit is contained in:
parent
43dc12a36c
commit
c9dc8c4676
205 changed files with 30793 additions and 328 deletions
56
src/frontend/xcecli/cmd/resources/resources.go
Normal file
56
src/frontend/xcecli/cmd/resources/resources.go
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package resources
|
||||
|
||||
import (
|
||||
"xcecli/config"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// NewResourcesCmd creates a command for querying resource information
|
||||
func NewResourcesCmd(configManager *config.ConfigManager) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "resources",
|
||||
GroupID: "query",
|
||||
Short: "Manage resources",
|
||||
Long: `Manage resources in the system.
|
||||
Use 'xce resources distribution list' to query resources distribution information.
|
||||
Use 'xce resources definition list' to query resources definition information.`,
|
||||
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// Display help when no subcommand is specified
|
||||
cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
// Add distribution subcommand
|
||||
distributionCmd := &cobra.Command{
|
||||
Use: "distribution",
|
||||
Short: "Manage resource distribution",
|
||||
Long: `Manage resource distribution information.
|
||||
Use 'xce resources distribution list' to query resources distribution information.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// Display help when no subcommand is specified
|
||||
cmd.Help()
|
||||
},
|
||||
}
|
||||
distributionCmd.AddCommand(NewListResourcesDistCmd(configManager))
|
||||
|
||||
// Add definition subcommand
|
||||
definitionCmd := &cobra.Command{
|
||||
Use: "definition",
|
||||
Short: "Manage resource definition",
|
||||
Long: `Manage resource definition information.
|
||||
Use 'xce resources definition list' to query resources definition information.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// Display help when no subcommand is specified
|
||||
cmd.Help()
|
||||
},
|
||||
}
|
||||
definitionCmd.AddCommand(NewListResourcesDefCmd(configManager))
|
||||
|
||||
// Add subcommands to main command
|
||||
cmd.AddCommand(distributionCmd)
|
||||
cmd.AddCommand(definitionCmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue