add switch to allow suffix on output file
This commit is contained in:
parent
9034b44053
commit
2426f65e48
|
@ -35,6 +35,7 @@ Usage
|
|||
dec-decode [OPTIONS] Files...
|
||||
|
||||
Application Options:
|
||||
-s, --suffix= add a suffix to the output file
|
||||
-v, --verbose show lots more information than is probably necessary
|
||||
|
||||
Help Options:
|
||||
|
|
|
@ -11,7 +11,8 @@ import (
|
|||
)
|
||||
|
||||
var opts struct {
|
||||
Verbose bool `short:"v" long:"verbose" description:"show lots more information than is probably necessary"`
|
||||
Suffix string `short:"s" long:"suffix" description:"add a suffix to the output file"`
|
||||
Verbose bool `short:"v" long:"verbose" description:"show lots more information than is probably necessary"`
|
||||
Positional struct {
|
||||
Files []string `description:"list of files to decode" required:"true"`
|
||||
} `positional-args:"true" required:"true"`
|
||||
|
@ -35,7 +36,13 @@ func main() {
|
|||
} else {
|
||||
outPath = path.Join(".", fileName+".iso")
|
||||
}
|
||||
//outPath += ".dmp"
|
||||
|
||||
if opts.Suffix != "" {
|
||||
if !strings.HasPrefix(opts.Suffix, ".") {
|
||||
outPath += "."
|
||||
}
|
||||
outPath += opts.Suffix
|
||||
}
|
||||
|
||||
signature := readSignature(fin)
|
||||
fin.Seek(0, io.SeekStart)
|
||||
|
|
Loading…
Reference in New Issue