-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.go
73 lines (68 loc) · 1.73 KB
/
commands.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
"github.com/marcelfarres/hrtftools/command"
)
var GlobalFlags = []cli.Flag{}
var Commands = []cli.Command{
{
Name: "parse",
Usage: "Parse HRTF from url.",
Action: command.CmdParse,
Flags: []cli.Flag{
cli.StringFlag{
EnvVar: "ENV_URL",
Name: "url",
Value: "http://recherche.ircam.fr/equipes/salles/listen/infomorph_display.php?subject=",
Usage: "URL where to fetch DB.",
},
cli.IntFlag{
EnvVar: "ENV_NUM-SUB",
Name: "num-subjects, s-num",
Value: 60,
Usage: "Total number of subjects in the DB.",
}},
},
{
Name: "best-match",
Usage: "Get best match",
Action: command.CmdBestMatch,
Flags: []cli.Flag{
cli.StringFlag{
EnvVar: "ENV_DB-FILE",
Name: "db-file, f",
Value: "output.json",
Usage: "File to extract the hrtf morphological data.",
},
cli.StringFlag{
EnvVar: "ENV_METHODE",
Name: "methode, m",
Value: "min-dist",
Usage: "Selection methode.",
},
cli.StringFlag{
EnvVar: "ENV_ACTIVE-MEASUREMENTS-N",
Name: "active-measurements-n, am-n",
Value: "",
Usage: "Which measurements you want to input, comma separeted.",
},
cli.StringFlag{
EnvVar: "ENV_ACTIVE-MEASUREMENTS-",
Name: "active-measurements-v, am-v",
Value: "",
Usage: "Value of measurements you want to input, comma separeted.",
},
cli.IntFlag{
EnvVar: "ENV_NUM-RESULTS",
Name: "num-results, r",
Value: 5,
Usage: "Total Results to show.",
}},
},
}
func CommandNotFound(c *cli.Context, command string) {
fmt.Fprintf(os.Stderr, "%s: '%s' is not a %s command. See '%s --help'.", c.App.Name, command, c.App.Name, c.App.Name)
os.Exit(2)
}