File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,11 @@ import (
9
9
"github.com/papermerge/pmdump/config"
10
10
)
11
11
12
+ const PMDUMP_VERSION = "0.2"
13
+
12
14
var configFile = flag .String ("c" , "" , "path to config file" )
13
15
var targetFile = flag .String ("f" , "" , "Target file - zipped tar archive file name were to dump" )
16
+ var version = flag .Bool ("version" , false , "show version and exit" )
14
17
15
18
const exportYaml = "export.yaml"
16
19
const exportCommand = "export"
@@ -19,8 +22,28 @@ const importCommand = "import"
19
22
func main () {
20
23
flag .Parse ()
21
24
25
+ flag .Usage = func () {
26
+ w := flag .CommandLine .Output ()
27
+
28
+ fmt .Fprintf (
29
+ w ,
30
+ "Usage: %s [-c config.yaml] [-f archive.tar.gz] export | import \n " ,
31
+ os .Args [0 ],
32
+ )
33
+
34
+ flag .PrintDefaults ()
35
+
36
+ fmt .Fprintf (w , "For more details check: https://github.com/papermerge/pmdump\n " )
37
+
38
+ }
39
+
22
40
args := flag .Args ()
23
41
42
+ if * version {
43
+ fmt .Println (PMDUMP_VERSION )
44
+ os .Exit (0 )
45
+ }
46
+
24
47
if * configFile == "" {
25
48
fmt .Fprintf (os .Stderr , "Missing configuration. Did you forget -c flag?\n " )
26
49
flag .Usage ()
You can’t perform that action at this time.
0 commit comments