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
|
diff --git a/cmd/spectre/main.go b/cmd/spectre/main.go
index d67aac49369826d101f50a521a384cd131a2d7e5..9248bc2add33ff8eb80061f076f542d7e31ae9f1 100644
--- a/cmd/spectre/main.go
+++ b/cmd/spectre/main.go
@@ -11,9 +11,12 @@ )
func main() {
fs := flag.NewFlagSet("spectre", flag.ExitOnError)
+ fs.Usage = func() {
+ fmt.Fprintln(fs.Output(), "spectre [FLAGS] [site]")
+ fs.PrintDefaults()
+ }
usernameFlag := fs.String("username", "", "username")
secretFlag := fs.String("secret", "", "secret")
- siteFlag := fs.String("site", "", "site")
counterFlag := fs.Int("counter", 1, "counter")
scoperFlag := fs.String("scoper", "com.lyndir.masterpassword", "scoper base")
scopeFlag := spectre.Authentication
@@ -38,7 +41,7 @@ if templateFlag == "" {
templateFlag = scopeFlag.DefaultTemplate()
}
- if *usernameFlag == "" || *secretFlag == "" || *siteFlag == "" {
+ if *usernameFlag == "" || *secretFlag == "" || len(os.Args) < 2 {
panic("username, secret, and site are required")
}
@@ -49,7 +52,7 @@ if err != nil {
panic(err)
}
- pw := s.Site(*siteFlag,
+ pw := s.Site(os.Args[1],
spectre.WithScope(scopeFlag),
spectre.WithTemplate(templateFlag),
spectre.WithCounter(*counterFlag),
|