]> Cypherpunks.ru repositories - nncp.git/commitdiff
Wrap long lines
authorSergey Matveev <stargrave@stargrave.org>
Sun, 13 Aug 2023 16:48:26 +0000 (19:48 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 13 Aug 2023 18:32:25 +0000 (21:32 +0300)
src/cmd/nncp-ack/main.go
src/cmd/nncp-call/main.go
src/cmd/nncp-caller/main.go
src/cmd/nncp-daemon/main.go
src/cmd/nncp-exec/main.go
src/cmd/nncp-file/main.go
src/cmd/nncp-freq/main.go
src/cmd/nncp-rm/main.go
src/cmd/nncp-trns/main.go

index 89c27bdbe472f3a8d2b17df01e286e998ef08d71..7342c848e9e0e4dc0e8ef0a51cec0b6655f30893 100644 (file)
@@ -44,8 +44,9 @@ func usage() {
 
 func main() {
        var (
-               cfgPath     = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
-               niceRaw     = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq), "Outbound packet niceness")
+               cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq),
+                       "Outbound packet niceness")
                minSizeRaw  = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
                viaOverride = flag.String("via", "", "Override Via path to destination node (ignored with -all)")
                spoolPath   = flag.String("spool", "", "Override path to spool")
index 496ee1bc27598d392a5e6685dcc594ebda0003b4..a684c98ca47103cc8caa82b206239b3fd21ba89f 100644 (file)
@@ -60,17 +60,27 @@ func main() {
                version     = flag.Bool("version", false, "Print version information")
                warranty    = flag.Bool("warranty", false, "Print warranty information")
 
-               onlineDeadlineSec = flag.Uint("onlinedeadline", 0, "Override onlinedeadline option")
-               maxOnlineTimeSec  = flag.Uint("maxonlinetime", 0, "Override maxonlinetime option")
-
-               autoToss       = flag.Bool("autotoss", false, "Toss after call is finished")
-               autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create seen/ files during tossing")
-               autoTossNoFile = flag.Bool("autotoss-nofile", false, "Do not process \"file\" packets during tossing")
-               autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing")
-               autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
-               autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
-               autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing")
-               autoTossNoACK  = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing")
+               onlineDeadlineSec = flag.Uint("onlinedeadline", 0,
+                       "Override onlinedeadline option")
+               maxOnlineTimeSec = flag.Uint("maxonlinetime", 0,
+                       "Override maxonlinetime option")
+
+               autoToss = flag.Bool("autotoss", false,
+                       "Toss after call is finished")
+               autoTossDoSeen = flag.Bool("autotoss-seen", false,
+                       "Create seen/ files during tossing")
+               autoTossNoFile = flag.Bool("autotoss-nofile", false,
+                       "Do not process \"file\" packets during tossing")
+               autoTossNoFreq = flag.Bool("autotoss-nofreq", false,
+                       "Do not process \"freq\" packets during tossing")
+               autoTossNoExec = flag.Bool("autotoss-noexec", false,
+                       "Do not process \"exec\" packets during tossing")
+               autoTossNoTrns = flag.Bool("autotoss-notrns", false,
+                       "Do not process \"trns\" packets during tossing")
+               autoTossNoArea = flag.Bool("autotoss-noarea", false,
+                       "Do not process \"area\" packets during tossing")
+               autoTossNoACK = flag.Bool("autotoss-noack", false,
+                       "Do not process \"ack\" packets during tossing")
        )
        log.SetFlags(log.Lshortfile)
        flag.Usage = usage
index e1e10f78729babb23f3b2023ea527b6947c299e9..08c4afafa7ea9115626dfdcbf3fca65dca90a00d 100644 (file)
@@ -51,14 +51,22 @@ func main() {
                version   = flag.Bool("version", false, "Print version information")
                warranty  = flag.Bool("warranty", false, "Print warranty information")
 
-               autoToss       = flag.Bool("autotoss", false, "Toss after call is finished")
-               autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create seen/ files during tossing")
-               autoTossNoFile = flag.Bool("autotoss-nofile", false, "Do not process \"file\" packets during tossing")
-               autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing")
-               autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
-               autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
-               autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing")
-               autoTossNoACK  = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing")
+               autoToss = flag.Bool("autotoss", false,
+                       "Toss after call is finished")
+               autoTossDoSeen = flag.Bool("autotoss-seen", false,
+                       "Create seen/ files during tossing")
+               autoTossNoFile = flag.Bool("autotoss-nofile", false,
+                       "Do not process \"file\" packets during tossing")
+               autoTossNoFreq = flag.Bool("autotoss-nofreq", false,
+                       "Do not process \"freq\" packets during tossing")
+               autoTossNoExec = flag.Bool("autotoss-noexec", false,
+                       "Do not process \"exec\" packets during tossing")
+               autoTossNoTrns = flag.Bool("autotoss-notrns", false,
+                       "Do not process \"trns\" packets during tossing")
+               autoTossNoArea = flag.Bool("autotoss-noarea", false,
+                       "Do not process \"area\" packets during tossing")
+               autoTossNoACK = flag.Bool("autotoss-noack", false,
+                       "Do not process \"ack\" packets during tossing")
        )
        log.SetFlags(log.Lshortfile)
        flag.Usage = usage
index 1ae9e94ead91954911041ee82c45742d17a84bf7..f4bf2c30a7204930f5e07e21b117452297072440 100644 (file)
@@ -137,7 +137,8 @@ func main() {
                bind      = flag.String("bind", "[::]:5400", "Address to bind to")
                ucspi     = flag.Bool("ucspi", false, "Is it started as UCSPI-TCP server")
                inetd     = flag.Bool("inetd", false, "Obsolete, use -ucspi")
-               yggdrasil = flag.String("yggdrasil", "", "Start Yggdrasil listener: yggdrasils://PRV[:PORT]?[bind=BIND][&pub=PUB][&peer=PEER][&mcast=REGEX[:PORT]]")
+               yggdrasil = flag.String("yggdrasil", "",
+                       "Start Yggdrasil listener: yggdrasils://PRV[:PORT]?[bind=BIND][&pub=PUB][&peer=PEER][&mcast=REGEX[:PORT]]")
                maxConn   = flag.Int("maxconn", 128, "Maximal number of simultaneous connections")
                noCK      = flag.Bool("nock", false, "Do no checksum checking")
                mcdOnce   = flag.Bool("mcd-once", false, "Send MCDs once and quit")
@@ -150,14 +151,22 @@ func main() {
                version   = flag.Bool("version", false, "Print version information")
                warranty  = flag.Bool("warranty", false, "Print warranty information")
 
-               autoToss       = flag.Bool("autotoss", false, "Toss after call is finished")
-               autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create seen/ files during tossing")
-               autoTossNoFile = flag.Bool("autotoss-nofile", false, "Do not process \"file\" packets during tossing")
-               autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing")
-               autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
-               autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
-               autoTossNoArea = flag.Bool("autotoss-noarea", false, "Do not process \"area\" packets during tossing")
-               autoTossNoACK  = flag.Bool("autotoss-noack", false, "Do not process \"ack\" packets during tossing")
+               autoToss = flag.Bool("autotoss", false,
+                       "Toss after call is finished")
+               autoTossDoSeen = flag.Bool("autotoss-seen", false,
+                       "Create seen/ files during tossing")
+               autoTossNoFile = flag.Bool("autotoss-nofile", false,
+                       "Do not process \"file\" packets during tossing")
+               autoTossNoFreq = flag.Bool("autotoss-nofreq", false,
+                       "Do not process \"freq\" packets during tossing")
+               autoTossNoExec = flag.Bool("autotoss-noexec", false,
+                       "Do not process \"exec\" packets during tossing")
+               autoTossNoTrns = flag.Bool("autotoss-notrns", false,
+                       "Do not process \"trns\" packets during tossing")
+               autoTossNoArea = flag.Bool("autotoss-noarea", false,
+                       "Do not process \"area\" packets during tossing")
+               autoTossNoACK = flag.Bool("autotoss-noack", false,
+                       "Do not process \"ack\" packets during tossing")
        )
        log.SetFlags(log.Lshortfile)
        flag.Usage = usage
index bd0b7a2ab64ccf83323dc97a9fe8905160de44f6..ebebd6b1b18a6beec9dde428842f261c272935bd 100644 (file)
@@ -39,21 +39,23 @@ func usage() {
 
 func main() {
        var (
-               noCompress   = flag.Bool("nocompress", false, "Do not compress input data")
-               cfgPath      = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
-               niceRaw      = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceExec), "Outbound packet niceness")
-               replyNiceRaw = flag.String("replynice", nncp.NicenessFmt(nncp.DefaultNiceFile), "Possible reply packet niceness")
-               minSize      = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
-               argMaxSize   = flag.Uint64("maxsize", 0, "Maximal allowable resulting packet size, in KiB")
-               viaOverride  = flag.String("via", "", "Override Via path to destination node")
-               spoolPath    = flag.String("spool", "", "Override path to spool")
-               logPath      = flag.String("log", "", "Override path to logfile")
-               quiet        = flag.Bool("quiet", false, "Print only errors")
-               showPrgrs    = flag.Bool("progress", false, "Force progress showing")
-               omitPrgrs    = flag.Bool("noprogress", false, "Omit progress showing")
-               debug        = flag.Bool("debug", false, "Print debug messages")
-               version      = flag.Bool("version", false, "Print version information")
-               warranty     = flag.Bool("warranty", false, "Print warranty information")
+               noCompress = flag.Bool("nocompress", false, "Do not compress input data")
+               cfgPath    = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               niceRaw    = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceExec),
+                       "Outbound packet niceness")
+               replyNiceRaw = flag.String("replynice", nncp.NicenessFmt(nncp.DefaultNiceFile),
+                       "Possible reply packet niceness")
+               minSize     = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
+               argMaxSize  = flag.Uint64("maxsize", 0, "Maximal allowable resulting packet size, in KiB")
+               viaOverride = flag.String("via", "", "Override Via path to destination node")
+               spoolPath   = flag.String("spool", "", "Override path to spool")
+               logPath     = flag.String("log", "", "Override path to logfile")
+               quiet       = flag.Bool("quiet", false, "Print only errors")
+               showPrgrs   = flag.Bool("progress", false, "Force progress showing")
+               omitPrgrs   = flag.Bool("noprogress", false, "Omit progress showing")
+               debug       = flag.Bool("debug", false, "Print debug messages")
+               version     = flag.Bool("version", false, "Print version information")
+               warranty    = flag.Bool("warranty", false, "Print warranty information")
        )
        log.SetFlags(log.Lshortfile)
        flag.Usage = usage
index f2a09de77f7e4dff95ddd59449d66d1a37a93ef3..a101431bd367132fa8f4cfb44854981ba1ca5fa1 100644 (file)
@@ -45,8 +45,9 @@ options by default. You can forcefully turn them off by specifying 0 value.
 
 func main() {
        var (
-               cfgPath      = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
-               niceRaw      = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile), "Outbound packet niceness")
+               cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile),
+                       "Outbound packet niceness")
                argMinSize   = flag.Int64("minsize", -1, "Minimal required resulting packet size, in KiB")
                argMaxSize   = flag.Uint64("maxsize", 0, "Maximal allowable resulting packets size, in KiB")
                argChunkSize = flag.Int64("chunked", -1, "Split file on specified size chunks, in KiB")
index b21113697ed51718737e52709c4681b788bdfdd1..986cc61f9575bd276ef8f799bcf0cff498c64e1f 100644 (file)
@@ -37,19 +37,21 @@ func usage() {
 
 func main() {
        var (
-               cfgPath      = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
-               niceRaw      = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq), "Outbound packet niceness")
-               replyNiceRaw = flag.String("replynice", nncp.NicenessFmt(nncp.DefaultNiceFile), "Reply file packet niceness")
-               minSize      = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
-               viaOverride  = flag.String("via", "", "Override Via path to destination node")
-               spoolPath    = flag.String("spool", "", "Override path to spool")
-               logPath      = flag.String("log", "", "Override path to logfile")
-               quiet        = flag.Bool("quiet", false, "Print only errors")
-               showPrgrs    = flag.Bool("progress", false, "Force progress showing")
-               omitPrgrs    = flag.Bool("noprogress", false, "Omit progress showing")
-               debug        = flag.Bool("debug", false, "Print debug messages")
-               version      = flag.Bool("version", false, "Print version information")
-               warranty     = flag.Bool("warranty", false, "Print warranty information")
+               cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFreq),
+                       "Outbound packet niceness")
+               replyNiceRaw = flag.String("replynice", nncp.NicenessFmt(nncp.DefaultNiceFile),
+                       "Reply file packet niceness")
+               minSize     = flag.Uint64("minsize", 0, "Minimal required resulting packet size, in KiB")
+               viaOverride = flag.String("via", "", "Override Via path to destination node")
+               spoolPath   = flag.String("spool", "", "Override path to spool")
+               logPath     = flag.String("log", "", "Override path to logfile")
+               quiet       = flag.Bool("quiet", false, "Print only errors")
+               showPrgrs   = flag.Bool("progress", false, "Force progress showing")
+               omitPrgrs   = flag.Bool("noprogress", false, "Omit progress showing")
+               debug       = flag.Bool("debug", false, "Print debug messages")
+               version     = flag.Bool("version", false, "Print version information")
+               warranty    = flag.Bool("warranty", false, "Print warranty information")
        )
        log.SetFlags(log.Lshortfile)
        flag.Usage = usage
index f2fc4e47f933e7b57da3eb4238a3575d6dcb2255..b1d15249047251dc183f9934fafaa345c8e4c046 100644 (file)
@@ -250,9 +250,11 @@ func main() {
                                                return err
                                        }
                                        if now.Sub(info.ModTime()) < oldBoundary {
-                                               ctx.LogD("rm-skip", nncp.LEs{{K: "File", V: pth}}, func(les nncp.LEs) string {
-                                                       return fmt.Sprintf("File %s: too fresh, skipping", pth)
-                                               })
+                                               ctx.LogD("rm-skip", nncp.LEs{{K: "File", V: pth}},
+                                                       func(les nncp.LEs) string {
+                                                               return fmt.Sprintf("File %s: too fresh, skipping", pth)
+                                                       },
+                                               )
                                                continue
                                        }
                                        if (*doNoCK && strings.HasSuffix(entry.Name(), nncp.NoCKSuffix)) ||
@@ -292,7 +294,9 @@ func main() {
                        }
                }
                removeSub := func(p string) error {
-                       return filepath.Walk(p, func(path string, info os.FileInfo, err error) error {
+                       return filepath.Walk(p, func(
+                               path string, info os.FileInfo, err error,
+                       ) error {
                                if err != nil {
                                        if errors.Is(err, fs.ErrNotExist) {
                                                return nil
index c587b802a9fa72e616f080a064f357ef347de232..ad023e92b0b551d428f5ea5142faffe5515504e1 100644 (file)
@@ -41,8 +41,9 @@ func usage() {
 
 func main() {
        var (
-               cfgPath     = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
-               niceRaw     = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile), "Outbound packet niceness")
+               cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
+               niceRaw = flag.String("nice", nncp.NicenessFmt(nncp.DefaultNiceFile),
+                       "Outbound packet niceness")
                viaOverride = flag.String("via", "", "Override Via path to destination node")
                spoolPath   = flag.String("spool", "", "Override path to spool")
                logPath     = flag.String("log", "", "Override path to logfile")