@section nncp-freq
@verbatim
-% nncp-freq [options] NODE:SRC DST
+% nncp-freq [options] NODE:SRC [DST]
@end verbatim
Send file request to @option{NODE}, asking it to send its @file{SRC}
file from @ref{CfgFreq, freq} directory to our node under @file{DST}
-filename in our @ref{CfgIncoming, incoming} one.
+filename in our @ref{CfgIncoming, incoming} one. If @file{DST} is not
+specified, then last element of @file{SRC} will be used.
If @ref{CfgNotify, notification} is enabled on the remote side for
file request, then it will sent simple letter after successful file
@node Новости
@section Новости
+@node Релиз 0.10
+@subsection Релиз 0.10
+@itemize
+@item
+@file{DST} аргумент @command{nncp-freq} команды теперь опционален.
+По-умолчанию будет подставлен последний элемент @file{SRC} пути.
+@end itemize
+
@node Релиз 0.9
@subsection Релиз 0.9
@itemize
See also this page @ref{Новости, on russian}.
+@node Release 0.10
+@section Release 0.10
+@itemize
+@item
+@command{nncp-freq}'s @file{DST} argument is optional now. Last
+@file{SRC} path's element will be used by default.
+@end itemize
+
@node Release 0.9
@section Release 0.9
@itemize
# $FreeBSD$
PORTNAME= nncp
-PORTVERSION= 0.9
+PORTVERSION= 0.10
CATEGORIES= net
MASTER_SITES= http://www.nncpgo.org/download/ \
http://sourceforge.net/projects/nncp/files/
"io/ioutil"
"log"
"os"
+ "path/filepath"
"strings"
"cypherpunks.ru/nncp"
func usage() {
fmt.Fprintf(os.Stderr, nncp.UsageHeader())
fmt.Fprintln(os.Stderr, "nncp-freq -- send file request\n")
- fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE:SRC DST\nOptions:\n", os.Args[0])
+ fmt.Fprintf(os.Stderr, "Usage: %s [options] NODE:SRC [DST]\nOptions:\n", os.Args[0])
flag.PrintDefaults()
}
fmt.Println(nncp.VersionGet())
return
}
- if flag.NArg() != 2 {
+ if flag.NArg() == 0 {
usage()
os.Exit(1)
}
log.Fatalln("Invalid NODE specified:", err)
}
+ var dst string
+ if flag.NArg() == 2 {
+ dst = flag.Arg(1)
+ } else {
+ dst = filepath.Base(splitted[1])
+ }
+
if err = ctx.TxFreq(
node,
nice,
splitted[1],
- flag.Arg(1),
+ dst,
int64(*minSize)*1024,
); err != nil {
log.Fatalln(err)