()
| 273 | } |
| 274 | |
| 275 | func newStorageContentListCmd() *cobra.Command { |
| 276 | cmd := &cobra.Command{ |
| 277 | Use: "list <node> <storage>", |
| 278 | Short: "List content in a storage", |
| 279 | Args: cobra.ExactArgs(2), |
| 280 | Example: ` pvetui storage content list pve01 local |
| 281 | pvetui storage content list pve01 local --type iso |
| 282 | pvetui storage content list pve01 local --output table`, |
| 283 | RunE: runStorageContentList, |
| 284 | } |
| 285 | |
| 286 | cmd.Flags().String("type", "", "Filter by content type (iso, vztmpl, backup, snippets, images)") |
| 287 | cmd.Flags().StringP("output", "o", "json", "Output format: json or table") |
| 288 | |
| 289 | cmd.ValidArgsFunction = completeStorageNames |
| 290 | |
| 291 | return cmd |
| 292 | } |
| 293 | |
| 294 | func runStorageContentList(cmd *cobra.Command, args []string) error { |
| 295 | ctx := context.Background() |
no test coverage detected