X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcmd%2Fnncp-freq%2Fmain.go;h=9c1f41fe1905c1d28b15ca6a49e24b758cd2bac6;hb=4ba3188c55713c2b3a2326ab6b670606f27a13f5;hp=25328875426a525d23035044449ccab3b784d286;hpb=2ac16acad8de20005793cbadd61068d38dc3b0ca;p=nncp.git diff --git a/src/cmd/nncp-freq/main.go b/src/cmd/nncp-freq/main.go index 2532887..9c1f41f 100644 --- a/src/cmd/nncp-freq/main.go +++ b/src/cmd/nncp-freq/main.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2019 Sergey Matveev +Copyright (C) 2016-2023 Sergey Matveev 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 @@ -26,12 +26,12 @@ import ( "path/filepath" "strings" - "go.cypherpunks.ru/nncp/v5" + "go.cypherpunks.ru/nncp/v8" ) func usage() { - fmt.Fprintf(os.Stderr, nncp.UsageHeader()) - fmt.Fprintf(os.Stderr, "nncp-freq -- send file request\n\n") + fmt.Fprint(os.Stderr, nncp.UsageHeader()) + fmt.Fprint(os.Stderr, "nncp-freq -- send file request\n\n") fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE:SRC [DST]\nOptions:\n", os.Args[0]) flag.PrintDefaults() } @@ -46,10 +46,13 @@ func main() { 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 flag.Parse() if *warranty { @@ -73,7 +76,15 @@ func main() { log.Fatalln(err) } - ctx, err := nncp.CtxFromCmdline(*cfgPath, *spoolPath, *logPath, *quiet, *debug) + ctx, err := nncp.CtxFromCmdline( + *cfgPath, + *spoolPath, + *logPath, + *quiet, + *showPrgrs, + *omitPrgrs, + *debug, + ) if err != nil { log.Fatalln("Error during initialization:", err) }