mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
remove list subcommand
This commit is contained in:
49
cmd/list.go
49
cmd/list.go
@@ -1,49 +0,0 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/turbot/steampipe/pkg/cmdconfig"
|
||||
)
|
||||
|
||||
// TODO #kai can we just remove this
|
||||
type listSubCmdOptions struct {
|
||||
parentCmd *cobra.Command
|
||||
}
|
||||
|
||||
func getListSubCmd(opts listSubCmdOptions) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "list",
|
||||
TraverseChildren: true,
|
||||
Args: cobra.NoArgs,
|
||||
Run: getRunListSubCmd(opts),
|
||||
Short: fmt.Sprintf("List all resources that can be executed with the '%s' command", opts.parentCmd.Name()),
|
||||
Long: fmt.Sprintf("List all resources that can be executed with the '%s' command", opts.parentCmd.Name()),
|
||||
}
|
||||
|
||||
cmdconfig.
|
||||
OnCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// getRunListSubCmd generates a command handler based on the parent command
|
||||
func getRunListSubCmd(opts listSubCmdOptions) func(cmd *cobra.Command, args []string) {
|
||||
if opts.parentCmd == nil {
|
||||
// this should never happen
|
||||
panic("parent is required")
|
||||
}
|
||||
|
||||
return func(cmd *cobra.Command, _ []string) {
|
||||
// TODO #v1 list query files? or deprecate list commena
|
||||
//ctx := cmd.Context()
|
||||
//
|
||||
//headers, rows := getOutputDataTable(modResources, depResources)
|
||||
//
|
||||
//display.ShowWrappedTable(headers, rows, &display.ShowWrappedTableOptions{
|
||||
// AutoMerge: false,
|
||||
// HideEmptyColumns: true,
|
||||
// Truncate: true,
|
||||
//})
|
||||
}
|
||||
}
|
||||
@@ -89,8 +89,6 @@ Examples:
|
||||
AddStringFlag(pconstants.ArgSnapshotLocation, "", "The location to write snapshots - either a local file path or a Turbot Pipes workspace").
|
||||
AddBoolFlag(pconstants.ArgProgress, true, "Display snapshot upload status")
|
||||
|
||||
cmd.AddCommand(getListSubCmd(listSubCmdOptions{parentCmd: cmd}))
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user