-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstellar-spaceship.go
51 lines (46 loc) · 1.01 KB
/
stellar-spaceship.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
package main
import (
"github.com/urfave/cli"
"log"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "stellar-spaceship"
app.Usage = "small terminal application for Stellar-based utilities"
app.Version = "0.0.1"
app.Commands = []cli.Command{
{
Name: "gen",
Aliases: []string{"g"},
Usage: "generate a new valid Stellar keypair",
Action: genKeypair,
},
{
Name: "parse",
Aliases: []string{"p"},
Usage: "return the corresponding Stellar address from a valid `SEED` string",
Action: parseAddressOrSeed,
},
{
Name: "derive",
Aliases: []string{"d"},
Usage: "derive a `RANGE` of keypairs from a desired `SEED`",
Flags: []cli.Flag{
cli.StringFlag{
Name: "seed, s",
Usage: "set the `SEED` from which to derive from",
},
cli.StringFlag{
Name: "range, r",
Usage: "set the `RANGE` of key_pairs to derive (e.g. 0..9)",
},
},
Action: deriveKeypairsFromSeed,
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}