-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
40 lines (31 loc) · 858 Bytes
/
main.go
File metadata and controls
40 lines (31 loc) · 858 Bytes
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
package main
import (
"fmt"
"os"
"runtime"
"strings"
"github.com/jessevdk/go-flags"
)
const apiServer = "https://gd2.line.naver.jp:443"
var parser = flags.NewParser(&common, flags.Default)
type Common struct {
User string `short:"u" long:"user" description:"User name" required:"yes"`
Device string `short:"d" long:"device" default:"PC" description:"Device name"`
ReportingServer string `short:"r" long:"reportingServer" description:"URL of the reporting server" default:"http://itwill.be/tsum"`
}
var common Common
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
if _, err := parser.Parse(); err != nil {
os.Exit(1)
}
fmt.Printf("\nCompleted.\n")
}
type prog struct {
str string
args []interface{}
}
func printProgress(p prog) {
fmt.Print(strings.Repeat(" ", 79), "\r")
fmt.Printf(p.str+"\r", p.args...)
}