mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-26 01:34:43 +03:00
a1ba6578da
* renamed cmdFlagChanged to flagChanged * initial stdin stuff working * wip: mostly working as expected * Docs and lots of cleanup * Mostly docs * fixed behavior of source.LocationWithPassword, and tests
25 lines
484 B
Go
25 lines
484 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newSrcListCmd() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "ls",
|
|
Short: "List data sources",
|
|
Long: "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)
|
|
}
|