@@ -12,22 +12,18 @@ import (
12
12
"github.com/sj14/multicode/decode"
13
13
)
14
14
15
- var (
16
- verbose bool
17
- byteDec bool
18
- hex bool
19
- base64 bool
20
- proto bool
21
- none bool
22
- )
15
+ var verbose bool
23
16
24
17
func main () {
25
18
// init flags
26
- flag .BoolVar (& byteDec , "byte" , true , "use byte decoding" )
27
- flag .BoolVar (& hex , "hex" , true , "use hex decoding" )
28
- flag .BoolVar (& base64 , "base64" , true , "use base64 decoding" )
29
- flag .BoolVar (& proto , "proto" , true , "use proto decoding" )
30
- // flag.BoolVar(&none, "none", false, "disable all decodings") // TODO: not working yet
19
+ var (
20
+ byteDec = flag .Bool ("byte" , true , "use byte decoding" )
21
+ hex = flag .Bool ("hex" , true , "use hex decoding" )
22
+ base64 = flag .Bool ("base64" , true , "use base64 decoding" )
23
+ proto = flag .Bool ("proto" , true , "use proto decoding" )
24
+ // none := flag.Bool("none", false, "disable all decodings") // TODO: not working yet
25
+ )
26
+
31
27
flag .BoolVar (& verbose , "v" , false , "verbose output mode" )
32
28
flag .Parse ()
33
29
@@ -59,16 +55,16 @@ func main() {
59
55
opts = append (opts , decode .WithoutAll ())
60
56
61
57
// Enable specifified decodings.
62
- if byteDec {
58
+ if * byteDec {
63
59
opts = append (opts , decode .WithByte ())
64
60
}
65
- if hex {
61
+ if * hex {
66
62
opts = append (opts , decode .WithHex ())
67
63
}
68
- if base64 {
64
+ if * base64 {
69
65
opts = append (opts , decode .WithBase64 ())
70
66
}
71
- if proto {
67
+ if * proto {
72
68
opts = append (opts , decode .WithProto ())
73
69
}
74
70
0 commit comments