示例#1
0
文件: autoclean.go 项目: dnephin/dobi
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
}
示例#2
0
文件: list.go 项目: dnephin/dobi
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
}