-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.go
66 lines (55 loc) · 1.82 KB
/
parser.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import (
"flag"
)
var Dirs string
var Lang string
var Method string
var Archive string
var Compress string
var IgnoresFiles string
var IgnoresExt string
func InitArgs() {
flag.StringVar(&Dirs, "dirs", "",
`List of directories to organize
Example for single dir : -dirs /home/username/Downloads
For multiple dirs : -dirs "/home/username/Downloads, docs/files,"`)
flag.StringVar(&Lang, "lang", "en",
`Language of created folders
Suported languages are en (english), fr (french), es (spanish)
By default lang is set to english
Example : -lang en
`)
flag.StringVar(&Method, "method", "type",
`Method used to organize files inside directories
This params take one of these four values : type, date, ext or alph
type : Files are regrouped regarding their types (videos, audios, docs, pictures,...)
date : Files are regrouped by their last update date (yyyy-mm-dd)
ext : Files are regrouped by their extension (mp3, docs, psd, ...)
alph : Files are regrouped using alphabetical order (A, B, C, ...)
Example : -method type
`)
flag.StringVar(&IgnoresFiles, "ef", "",
`Exclude some files while organising directories
Example for one file : -ef file.txt
Example for mulitple files : -ef "file1.txt, file2.txt, file3.txt"
`)
flag.StringVar(&IgnoresExt, "ex", "",
`Excludes files with given extensions
Example for one extension : -ex txt
Example for mulitple extensions : -ex "mp3, txt, json"
`)
flag.StringVar(&Archive, "archive", "zip",
`(Not working yet)
Archive created folders with specified method
Suported methods are zip and tar
Example : -archive zip
`)
flag.StringVar(&Compress, "compress", "gzip",
`(Not working yet)
Compress created folders with specified algorithm
Suported algorithms are : bzip2, flate, gzip, lzw, zlib
Example : -archive gzip
`)
flag.Parse()
}