Beispiel #1
0
func removeTasks(conf *config.Config) []string {
	resources := conf.Sorted()
	tasks := []string{}
	for i := len(resources) - 1; i >= 0; i-- {
		tasks = append(tasks, resources[i]+":rm")
	}
	return tasks
}
Beispiel #2
0
func getDescriptions(config *config.Config, listOpts listOptions) []string {
	lines := []string{}
	for _, name := range config.Sorted() {
		res := config.Resources[name]
		desc := res.Describe()
		if desc == "" {
			if !listOpts.all {
				continue
			}
			desc = res.String()
		}
		lines = append(lines, fmt.Sprintf("  %-20s %s\n", name, desc))
	}
	return lines
}