]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/cmd/nncp-reass/main.go
Forbid any later GNU GPL versions autousage
[nncp.git] / src / cypherpunks.ru / nncp / cmd / nncp-reass / main.go
index ea139ce00eb000860c7c00cfdbc9a3329726a06f..d6df787955f1310bd19f6f8a15d6f997901cb7d0 100644 (file)
@@ -4,8 +4,7 @@ Copyright (C) 2016-2019 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, version 3 of the License.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -320,10 +319,10 @@ func main() {
        }
 
        if flag.NArg() > 0 {
-               if !process(ctx, flag.Arg(0), *keep, *dryRun, *stdout, *dumpMeta) {
-                       os.Exit(1)
+               if process(ctx, flag.Arg(0), *keep, *dryRun, *stdout, *dumpMeta) {
+                       return
                }
-               return
+               os.Exit(1)
        }
 
        hasErrors := false
@@ -337,7 +336,9 @@ func main() {
                                if _, seen := seenMetaPaths[metaPath]; seen {
                                        continue
                                }
-                               hasErrors = hasErrors || !process(ctx, metaPath, *keep, *dryRun, false, false)
+                               if !process(ctx, metaPath, *keep, *dryRun, false, false) {
+                                       hasErrors = true
+                               }
                                seenMetaPaths[metaPath] = struct{}{}
                        }
                }
@@ -346,7 +347,9 @@ func main() {
                        log.Fatalln("Specified -node does not allow incoming")
                }
                for _, metaPath := range findMetas(ctx, *nodeOnly.Incoming) {
-                       hasErrors = hasErrors || !process(ctx, metaPath, *keep, *dryRun, false, false)
+                       if !process(ctx, metaPath, *keep, *dryRun, false, false) {
+                               hasErrors = true
+                       }
                }
        }
        if hasErrors {