-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpicvMain.go
More file actions
51 lines (40 loc) · 1.09 KB
/
Copy pathpicvMain.go
File metadata and controls
51 lines (40 loc) · 1.09 KB
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
////////////////////////////////////////////////////////////////////////////
// Program: picv
// Purpose: picture vault
// Authors: Tong Sun (c) 2017, All rights reserved
////////////////////////////////////////////////////////////////////////////
package main
//go:generate sh -v picvCLIGen.sh
import (
"fmt"
"os"
"github.com/mkideal/cli"
)
////////////////////////////////////////////////////////////////////////////
// Global variables definitions
var (
progname = "picv"
VERSION = "0.2.0"
buildTime = "2017-06-03"
)
////////////////////////////////////////////////////////////////////////////
// Function definitions
// Function main
func main() {
//NOTE: You can set any writer implements io.Writer
// default writer is os.Stdout
if err := cli.Root(root,
cli.Tree(cutDef),
cli.Tree(archDef)).Run(os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, err)
}
fmt.Println("")
}
//==========================================================================
// Main dispatcher
func picv(ctx *cli.Context) error {
ctx.JSON(ctx.RootArgv())
ctx.JSON(ctx.Argv())
fmt.Println()
return nil
}