Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "collections", Aliases: []string{"c", "col", "collection"}, Short: "Search for and discover Collections", Example: ` Search for all collections by short name prefix: cmrfetch collections -s "CLDMSK_*" Search for multiple collection short names: cmrfetch collections -s CLDMSK_L2_VIIRS_SNPP -s CLDMSK_L2_VIIRS_NOAA20,CLDMSK_L2_MODIS_Aqua Search for a collection by keyword: cmrfetch collections -k aerdt Search for a collection by platform: cmrfetch collections -p Suomi-NPP `, RunE: func(cmd *cobra.Command, args []string) error { flags := cmd.Flags() output, err := flags.GetString("output") failOnError(err) params, err := newParams(flags) if err != nil { return err } verbose, err := flags.GetBool("verbose") failOnError(err) var logger *log.Logger if verbose { logger = log.New(os.Stderr, "", log.LstdFlags) } api := internal.NewCMRSearchAPI(logger) var writer outputWriter switch output { case "brief": writer = tableWriter case "short": writer = shortWriter case "long": writer = longWriter default: return fmt.Errorf("--output must be one of brief, short or long") } if !haveFilterFlags(flags) { return fmt.Errorf("at least one of %s is required", requiredFlags()) } return do(api, params, writer) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.