You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main.go
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import (
8
8
"os"
9
9
)
10
10
11
-
constVersion=2
11
+
constVersion=3
12
12
constName="convertapi"
13
13
constHelpFlagName="help"
14
14
@@ -18,6 +18,8 @@ func main() {
18
18
paramsF:=flag.String("params", "", "conversion parameters, see full list of available parameters at https://www.convertapi.com . Allowed values: [ value | @<path> | @< | < | << ]. Usage example: --params=\"file:@/path/to/file.doc, pdftitle:My title\"")
19
19
outF:=flag.String("out", "url", "place where to output converted files. Allowed values: [ url | @<path> | stdout ]. Save to directory example: --out=\"@/path/to/dir\" ")
20
20
secretF:=flag.String("secret", "", "ConvertAPI user secret. Get your secret at https://www.convertapi.com/a")
21
+
tokenF:=flag.String("token", "", "ConvertAPI user token. Get your secret at https://www.convertapi.com/a/auth")
22
+
apikeyF:=flag.String("apikey", "", "ConvertAPI user apikey. Get your secret at https://www.convertapi.com/a/auth")
21
23
verF:=flag.Bool("version", false, "output version information and exit")
22
24
helpF:=flag.Bool(HelpFlagName, false, "display this help and exit")
23
25
flag.Parse()
@@ -36,7 +38,12 @@ func main() {
36
38
}
37
39
38
40
if*secretF=="" {
39
-
printError(errors.New("ConvertAPI user secret is not set. Please set --secret parameter. Get your secret at https://www.convertapi.com/a"), 1)
41
+
if*tokenF=="" {
42
+
printError(errors.New("ConvertAPI user secret is not set. Please set --secret or --token parameter. Get your secret at https://www.convertapi.com/a"), 1)
0 commit comments