mirror of
https://github.com/wader/fq.git
synced 2024-12-23 13:22:58 +03:00
format,interp: Use MustGroup and add probe order test
This commit is contained in:
parent
8a4f66f616
commit
aa38ccf0e1
21
format/all/all.fqtest
Normal file
21
format/all/all.fqtest
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
$ fq -n _registry.groups.probe
|
||||||
|
[
|
||||||
|
"adts",
|
||||||
|
"bzip2",
|
||||||
|
"elf",
|
||||||
|
"flac",
|
||||||
|
"gif",
|
||||||
|
"gzip",
|
||||||
|
"jpeg",
|
||||||
|
"matroska",
|
||||||
|
"mp4",
|
||||||
|
"ogg",
|
||||||
|
"png",
|
||||||
|
"tar",
|
||||||
|
"tiff",
|
||||||
|
"webp",
|
||||||
|
"mpeg_ts",
|
||||||
|
"wav",
|
||||||
|
"mp3",
|
||||||
|
"json"
|
||||||
|
]
|
@ -395,10 +395,10 @@ func (i *Interp) _registry(c interface{}, a []interface{}) interface{} {
|
|||||||
groups := map[string]interface{}{}
|
groups := map[string]interface{}{}
|
||||||
formats := map[string]interface{}{}
|
formats := map[string]interface{}{}
|
||||||
|
|
||||||
for fsName, fs := range i.registry.Groups {
|
for fsName := range i.registry.Groups {
|
||||||
var group []interface{}
|
var group []interface{}
|
||||||
|
|
||||||
for _, f := range fs {
|
for _, f := range i.registry.MustGroup(fsName) {
|
||||||
group = append(group, f.Name)
|
group = append(group, f.Name)
|
||||||
if _, ok := uniqueFormats[f.Name]; ok {
|
if _, ok := uniqueFormats[f.Name]; ok {
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user