mirror of
https://github.com/neilotoole/sq.git
synced 2024-11-28 12:33:44 +03:00
58ccfc9ded
* Type Detector refactor * json driver impl; refactoring of source.Files reader et al * working on kind detector * significant switcheroo of packages * partway throught refactoring Kind * major package switcheroo for Kind
27 lines
586 B
Go
27 lines
586 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/neilotoole/sq/libsq/core/errz"
|
|
)
|
|
|
|
func newSrcListCmd() (*cobra.Command, runFunc) {
|
|
cmd := &cobra.Command{
|
|
Use: "ls",
|
|
Short: "List data sources",
|
|
}
|
|
|
|
cmd.Flags().BoolP(flagVerbose, flagVerboseShort, false, flagVerboseUsage)
|
|
cmd.Flags().BoolP(flagHeader, flagHeaderShort, false, flagHeaderUsage)
|
|
return cmd, execSrcList
|
|
}
|
|
|
|
func execSrcList(rc *RunContext, cmd *cobra.Command, args []string) error {
|
|
if len(args) != 0 {
|
|
return errz.Errorf(msgInvalidArgs)
|
|
}
|
|
|
|
return rc.writers.srcw.SourceSet(rc.Config.Sources)
|
|
}
|