X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fcommand_line.rst;h=5125d0e6dc9f6a588b6f654bb8b8b075b394ea57;hb=f500438f9ec07d6242b6f5c06125a6df7d696919;hp=da05ed2ba537dd95ada4953d536d0b63eb2384b0;hpb=46d1f9fa96d1bc61523fa98647ea1ba948fbc159;p=m_librarian.git diff --git a/docs/command_line.rst b/docs/command_line.rst index da05ed2..5125d0e 100644 --- a/docs/command_line.rst +++ b/docs/command_line.rst @@ -113,12 +113,12 @@ name starts with "mack", case insensitive. With one option `-v` it also prints database id. -Book search -^^^^^^^^^^^ +Book searching and downloading +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Usage:: - ml-search.py books [-t title] [-s series] [-a archive] [-f file] [--id id] [--surname name] [--name name] [--misc-name name] [--fullname name] [--aid aid] [-e ext] [--eid eid] [--gname name] [--gtitle title] [--gid gid] [-l lang] [--lid lid] + ml-search.py books [-t title] [-s series] [-a archive] [-f file] [-p path] [--get] [--get-many N] [--id id] [--surname name] [--name name] [--misc-name name] [--fullname name] [--aid aid] [-e ext] [--eid eid] [--gname name] [--gtitle title] [--gid gid] [-l lang] [--lid lid] Search and print a list of books by title, series, archive or file name. @@ -128,6 +128,10 @@ Options:: -s, --series series Search by series -a, --archive archive Search by archive (zip file) -f, --file file Search by file name (without extension) + -p, --path path Path to the directory with the library + archives + --get Download exactly one book + --get-many N Download at most this many books --id id Search by database id --surname surname Search by author’s surname --name name Search by author’s name @@ -150,6 +154,47 @@ it also prints the file date and language. With three `-v` it prints archive name, file name, extension and size, and flag if the book is marked to be deleted. +Option `-p` provides the path to the directory with the library +archives. By default the path is extracted from `m_librarian.conf`, +section `[library]`, key `path`:: + + [library] + path = /var/lib/archives + +The option is useful for multiple databases (global option `-d`). + +Option `--get` allows to download a book from the library to a local +file. The option allows to download exactly one book. The simplest way +to use it is via option `--id`. The file is downloaded into the current +directory with the name from the library. + +Configuration key + +| [download] +| format = %a/%s/%n %t + +allows to set format for the download file pathname. Default format is +`%f`, i.e. just filename. Other format specifiers are:: + + %a - author (one of if many) + %e - file extension + %f - file name in archive + %G - genre (one of if many), name + %g - genre (one of if many), title + %l - language + %n - series number (or 0) + %s - series + %t - title + +Format must not end in directory separator (`/` or `\\`). If specifier +`%e` (extension) is not found in the format it is appended +unconditionally with a dot. That is, format `%f` is equivalent to +`%f.%e`. + +Option `--get-many N` allows to download many books (at most N, where N +is an integer). Options `--get-many N` and `--get` are, of course, +mutually incompatible. + Extension search ^^^^^^^^^^^^^^^^