-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
50 lines (40 loc) · 987 Bytes
/
main.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
package main
import (
"flag"
"fmt"
"log"
"os"
"github.com/yuekcc/picar/internal/picarcore"
)
var (
flagPrefix string
flagRenameOnly bool
flagParseVideo bool
flagVersion bool
)
func init() {
flag.StringVar(&flagPrefix, "prefix", "", "设置文件名的前缀")
flag.BoolVar(&flagRenameOnly, "renameonly", false, "只重命名文件名")
flag.BoolVar(&flagParseVideo, "video", false, "处理视频文件")
flag.BoolVar(&flagVersion, "version", false, "显示版本号")
}
func showVersion() {
fmt.Printf("picar, version %s (%s)\n", VERSION, COMMIT_ID)
os.Exit(1)
}
func main() {
flag.Parse()
if flagVersion {
showVersion()
}
log.Println("picar, a tool for rename and archiving photos.")
log.Println("version", VERSION)
log.Println("a tool from yuekcc, build with love.")
config := picarcore.Config{
ParseVideo: flagParseVideo,
RenameOnly: flagRenameOnly,
Prefix: flagPrefix,
PhotoFolders: flag.Args(),
}
picarcore.Run(config)
}