| 219 | } |
| 220 | |
| 221 | func commandForCategory(cfg conf.OpenConfig, category string) []string { |
| 222 | switch category { |
| 223 | case openCategoryText: |
| 224 | if len(cfg.Text) > 0 { |
| 225 | return append([]string{}, cfg.Text...) |
| 226 | } |
| 227 | case openCategoryImage: |
| 228 | if len(cfg.Image) > 0 { |
| 229 | return append([]string{}, cfg.Image...) |
| 230 | } |
| 231 | case openCategoryVideo: |
| 232 | if len(cfg.Video) > 0 { |
| 233 | return append([]string{}, cfg.Video...) |
| 234 | } |
| 235 | case openCategoryAudio: |
| 236 | if len(cfg.Audio) > 0 { |
| 237 | return append([]string{}, cfg.Audio...) |
| 238 | } |
| 239 | case openCategoryPDF: |
| 240 | if len(cfg.PDF) > 0 { |
| 241 | return append([]string{}, cfg.PDF...) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | if len(cfg.Default) > 0 { |
| 246 | return append([]string{}, cfg.Default...) |
| 247 | } |
| 248 | return nil |
| 249 | } |
| 250 | |
| 251 | func defaultOpenCommand(goos string, category string) []string { |
| 252 | switch goos { |