|
|
|
@ -6,23 +6,24 @@ func main() {
|
|
|
|
|
app := App{
|
|
|
|
|
Name: "math",
|
|
|
|
|
Description: "a simple command line math utility",
|
|
|
|
|
Commands: []Command{
|
|
|
|
|
{
|
|
|
|
|
Name: "add",
|
|
|
|
|
Description: "Add 2 and 2",
|
|
|
|
|
Action: DoAdd},
|
|
|
|
|
{
|
|
|
|
|
Name: "subtract",
|
|
|
|
|
Description: "Subtract 2 and 2",
|
|
|
|
|
Action: DoSubtract},
|
|
|
|
|
{
|
|
|
|
|
Name: "multiply",
|
|
|
|
|
Description: "Multiply 2 and 2",
|
|
|
|
|
Action: DoMultiply},
|
|
|
|
|
{
|
|
|
|
|
Name: "divide",
|
|
|
|
|
Description: "Divide 2 and 2",
|
|
|
|
|
Action: DoDivide}}}
|
|
|
|
|
Commands: []Command{{
|
|
|
|
|
Name: "add",
|
|
|
|
|
Description: "Add 2 and 2",
|
|
|
|
|
Action: DoAdd,
|
|
|
|
|
}, {
|
|
|
|
|
Name: "subtract",
|
|
|
|
|
Description: "Subtract 2 and 2",
|
|
|
|
|
Action: DoSubtract,
|
|
|
|
|
}, {
|
|
|
|
|
Name: "multiply",
|
|
|
|
|
Description: "Multiply 2 and 2",
|
|
|
|
|
Action: DoMultiply,
|
|
|
|
|
}, {
|
|
|
|
|
Name: "divide",
|
|
|
|
|
Description: "Divide 2 and 2",
|
|
|
|
|
Action: DoDivide,
|
|
|
|
|
}},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.Run(os.Args[1])
|
|
|
|
|
}
|
|
|
|
|