improved command line argument handling
This commit is contained in:
parent
c2a36c3d31
commit
281287937e
3
main.go
3
main.go
@ -80,7 +80,6 @@ func Convert(inputFilePath string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
outputFilePath := fmt.Sprintf("%s.pdf", filepath.Base(inputFilePath)[:len(inputFilePath)-len(filepath.Ext(inputFilePath))])
|
outputFilePath := fmt.Sprintf("%s.pdf", filepath.Base(inputFilePath)[:len(inputFilePath)-len(filepath.Ext(inputFilePath))])
|
||||||
fmt.Println(outputFilePath)
|
|
||||||
args := append([]string{"--output", outputFilePath}, tempFiles...)
|
args := append([]string{"--output", outputFilePath}, tempFiles...)
|
||||||
img2pdf := exec.Command("img2pdf", args...)
|
img2pdf := exec.Command("img2pdf", args...)
|
||||||
|
|
||||||
@ -93,4 +92,6 @@ func Convert(inputFilePath string) {
|
|||||||
ColorRed.Fprintf(os.Stderr, "img2pdf returned an error: %s\n", err.Error())
|
ColorRed.Fprintf(os.Stderr, "img2pdf returned an error: %s\n", err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println(outputFilePath)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user