Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DatasetCmd = &cobra.Command{ Use: "dataset", Short: "Set your current working dataset.", Long: `Set your current working dataset.`, Run: func(cmd *cobra.Command, args []string) { showFull, _ := cmd.Flags().GetBool("full") var userSettings models.UserSettings s, _ := userSettings.Get() client := api.PennsieveClient response, err := client.Dataset.Get(nil, s.UseDatasetId) if err != nil { log.Fatalln("Unknown dataset: ", s.UseDatasetId) } PrettyPrint(response, showFull) }, }
whoamiCmd represents the whoami command
View Source
var ListCmd = &cobra.Command{ Use: "list", Short: "Set your current working dataset.", Long: `Set your current working dataset.`, Run: func(cmd *cobra.Command, args []string) { }, }
whoamiCmd represents the whoami command
View Source
var UseCmd = &cobra.Command{ Use: "use <dataset>", Short: "Set your current working dataset.", Long: `Set your current working dataset. ARGS: <dataset> A dataset's ID. If omitted, the current dataset will be printed. `, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { datasetId := args[0] client := api.PennsieveClient response, err := client.Dataset.Get(nil, datasetId) if err != nil { log.Fatalln("Unknown dataset: ", datasetId) } // 2. Update UserSettings to contain dataset ID var userSettings models.UserSettings err = userSettings.UpdateActiveDataset(datasetId) if err != nil { log.Fatalln("Unable to update UserSettings:", err) } PrettyPrint(response, false) }, }
whoamiCmd represents the whoami command
Functions ¶
func PrettyPrint ¶
func PrettyPrint(ds *pennsieve.GetDatasetResponse, showFull bool)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.