MCPcopy Create free account
hub / github.com/52funny/pikpakcli / commandForCategory

Function commandForCategory

internal/shell/open.go:221–249  ·  view source on GitHub ↗
(cfg conf.OpenConfig, category string)

Source from the content-addressed store, hash-verified

219}
220
221func 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
251func defaultOpenCommand(goos string, category string) []string {
252 switch goos {

Callers 1

buildOpenCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected