-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd.go
28 lines (25 loc) · 595 Bytes
/
cmd.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
package main
import (
"fmt"
"os"
)
var (
// Username ...
Username string
// PrivateKey ...
PrivateKey string
// URL RPC url
URL string
)
// CheckArgs ...
func CheckArgs() {
// check if username is empty
if Username == "" {
msg := "Note:\n\tThis app is experimental, I'm just playing with a whisper protocol.\n"
msg += "\tRun first go-ethereum 'geth --testnet --nodiscover --shh --rpc'\n"
msg += "\tRun 'pchat --help' for more flags information.\n\n"
msg += "USAGE:\n\tpchat -username [argument] [flag option] [argument]\n\n"
fmt.Fprintln(os.Stderr, msg)
os.Exit(1)
}
}