|
@@ -531,18 +531,24 @@ func main() {
|
|
|
|
|
|
if showCommand.Parsed() {
|
|
|
// Show Fonts
|
|
|
+ var exit bool
|
|
|
if len(fontList) == 0 {
|
|
|
showCommand.Usage()
|
|
|
fmt.Println("No Fonts selected.")
|
|
|
- os.Exit(2)
|
|
|
+ exit = true
|
|
|
}
|
|
|
|
|
|
if len(showCommand.Args()) == 0 {
|
|
|
- showCommand.Usage()
|
|
|
+ if !exit {
|
|
|
+ showCommand.Usage()
|
|
|
+ }
|
|
|
fmt.Println("No TDF Fonts files given.")
|
|
|
- os.Exit(2)
|
|
|
+ exit = true
|
|
|
}
|
|
|
|
|
|
+ if exit {
|
|
|
+ os.Exit(2)
|
|
|
+ }
|
|
|
for _, fontfile := range showCommand.Args() {
|
|
|
fmt.Println("FILE:", fontfile)
|
|
|
DisplayFonts(fontfile, fontList, width)
|
|
@@ -551,15 +557,24 @@ func main() {
|
|
|
|
|
|
if extractCommand.Parsed() {
|
|
|
// Extract Fonts
|
|
|
+ var exit bool
|
|
|
+
|
|
|
if len(fontList) == 0 {
|
|
|
extractCommand.Usage()
|
|
|
fmt.Println("No Fonts selected.")
|
|
|
- os.Exit(2)
|
|
|
+ exit = true
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if len(extractCommand.Args()) == 0 {
|
|
|
- extractCommand.Usage()
|
|
|
+ if !exit {
|
|
|
+ extractCommand.Usage()
|
|
|
+ }
|
|
|
fmt.Println("No TDF Fonts files given.")
|
|
|
+ exit = true
|
|
|
+ }
|
|
|
+
|
|
|
+ if exit {
|
|
|
os.Exit(2)
|
|
|
}
|
|
|
|