mirror of
https://github.com/neilotoole/sq.git
synced 2024-11-28 12:33:44 +03:00
703f6d2427
* Refactored verbose/header flags; inspect cmd now less verbose by default * Updated changelog * README update
24 lines
453 B
Go
24 lines
453 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newSrcListCmd() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "ls",
|
|
Short: "List data sources",
|
|
Args: cobra.ExactArgs(0),
|
|
RunE: execSrcList,
|
|
}
|
|
|
|
cmd.Flags().BoolP(flagHeader, flagHeaderShort, false, flagHeaderUsage)
|
|
return cmd
|
|
}
|
|
|
|
func execSrcList(cmd *cobra.Command, args []string) error {
|
|
rc := RunContextFrom(cmd.Context())
|
|
|
|
return rc.writers.srcw.SourceSet(rc.Config.Sources)
|
|
}
|