mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-01 03:14:02 +03:00
ed9aa38a67
* Expose source.Set.Data() method * jsonw.writeJSON cleaned up * sq add now respects --json * Location strings are subject to more scrutiny * Ignore .db files in project dir * sq add is more restrictive about location string * source.RedactedLocation now uses 'xxxxx' per stdlib url.URL.Redacted() * Update changelog for v0.23.0 * typos
26 lines
550 B
Go
26 lines
550 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)
|
|
cmd.Flags().BoolP(flagJSON, flagJSONShort, false, flagJSONUsage)
|
|
return cmd
|
|
}
|
|
|
|
func execSrcList(cmd *cobra.Command, args []string) error {
|
|
rc := RunContextFrom(cmd.Context())
|
|
|
|
return rc.writers.srcw.SourceSet(rc.Config.Sources)
|
|
}
|