(expr string)
| 10 | ) |
| 11 | |
| 12 | func doFilterSelection(expr string) models.Shells { |
| 13 | // first match by group, full match |
| 14 | for group, shells := range Groups { |
| 15 | if expr == group { |
| 16 | return shells |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // then by shell name, full or prefix |
| 21 | found := models.Shells{} |
| 22 | for _, sh := range Shells { |
| 23 | if sh.Name == expr || strings.HasPrefix(sh.Name, expr) { |
| 24 | found[sh.Name] = sh |
| 25 | } |
| 26 | } |
| 27 | return found |
| 28 | } |
| 29 | |
| 30 | func doEnabledSelection(m models.Shells, includeDisabled bool) models.Shells { |
| 31 | sel := models.Shells{} |