Skip to content

Commit 98467c3

Browse files
committed
use ql.QLKeys
1 parent 76e0fa5 commit 98467c3

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

foxden/cmd/describe.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ package cmd
66
//
77
import (
88
"fmt"
9+
"strings"
910

11+
ql "github.com/CHESSComputing/golib/ql"
1012
schema "github.com/CHESSComputing/golib/schema"
1113
"github.com/spf13/cobra"
1214
)
@@ -21,19 +23,14 @@ func describeUsage() {
2123
}
2224

2325
func describeKey(args []string) {
24-
schemas := []string{"ID1A3", "ID3A", "ID4B"}
25-
for _, sname := range schemas {
26-
umap := _metaManager.Units(sname)
27-
dmap := _metaManager.Descriptions(sname)
28-
fmt.Printf("Schema: %s\n", sname)
26+
qlKeys, err := ql.QLKeys("")
27+
if err != nil {
28+
exit("unable to get FOXDEN QL keys", err)
29+
}
30+
for _, elem := range qlKeys {
2931
for _, key := range args {
30-
if val, ok := dmap[key]; ok {
31-
fmt.Printf("%s: %s\n", key, val)
32-
}
33-
if val, ok := umap[key]; ok {
34-
if val != "" {
35-
fmt.Printf("%s: units in %s\n", key, val)
36-
}
32+
if strings.HasPrefix(elem, key) {
33+
fmt.Println(elem)
3734
}
3835
}
3936
}

0 commit comments

Comments
 (0)