]> git.phdru.name Git - m_librarian.git/blob - docs/command_line.rst
Search authors/extensions/genres/languages by database id
[m_librarian.git] / docs / command_line.rst
1
2 Command-line scripts
3 ====================
4
5
6 .. contents::
7    :local:
8
9
10 ml-initdb.py
11 ------------
12
13 Initialize database and import genres list. Isn’t really needed as
14 the next script does all that too.
15
16
17 ml-import.py
18 ------------
19
20 Usage::
21
22     ml-import.py [file.inpx ...]
23
24 Initialize database, import genres list and import a list of INPX files
25 listed in the command line. On subsequent runs doesn’t destroy DB or
26 reimport genres; it also skips already import books but import new ones.
27
28
29 ml-search.py
30 ------------
31
32 Usage::
33
34     ml-search.py [-i] [-I] [-t] [-s] [-f] [-d] [-c] ...
35
36 Search through the database and display results. Currently can only
37 search authors by name.
38
39 Global options::
40
41     -i, --ignore-case     ignore case (default is to guess)
42     -I, --case-sensitive  don’t ignore case
43     -t, --start           search type: substring at the start
44                           (this is the default)
45     -s, --substring       search type: substring anywhere
46     -f, --full            search type: match the full string
47     -d, --details         Output more details about found objects;
48                           repeat for even more details
49     -c, --count           Output count of found objects
50
51 Options ``-i/-I`` cannot be used together as they are the opposite. In
52 case none of them are used the program guesses case-sensitivity by
53 looking at the arguments. If all arguments are lowercase the program
54 performs case-insensitive search. If there are UPPERCASE or MixedCase
55 arguments the program performs case-sensitive search.
56
57 Options ``-t/-s/-f`` define the search type. Search types are:
58
59 * start - search for substring at the start of the search field; for
60   example searching for "duck" returns results for "duck" and "duckling"
61   but not for "McDuck"; this is the default search type.
62 * substring - search for any substring; "duck" => "duck", "duckling",
63   "McDuck" (except for case-sensitive search, of course).
64 * full - search for exact match, compare the entire strings;
65   i.e. searching for "duck" returns results for "duck" but not for
66   "duckling";
67
68
69 Author search
70 ^^^^^^^^^^^^^
71
72 Usage::
73
74     ml-search.py [-i/-I] [-t/-s/-f] author [-s surname] [-n name] [-m misc-name] [--id id] [fullname]
75
76 Search and print a list of authors by surname/name/misc name/full name.
77
78 Options::
79
80     -s, --surname surname       Search by surname
81     -n, --name name             Search by name
82     -m, --misc-name misc. name  Search by misc. name
83     --id id                     Search by database id
84
85 Example::
86
87     ml-search.py -i author -s duck
88
89 Search and print a list of authors whose surname starts with "duck",
90 case insensitive.
91
92 If a few options are given the search is limited with operator AND.
93 Example::
94
95     ml-search.py -i author -s duck -n mack
96
97 Search and print a list of authors whose surname starts with "duck" and
98 name starts with "mack", case insensitive.
99
100 With one option `-d` it also prints database id.
101
102
103 Book search
104 ^^^^^^^^^^^
105
106 Usage::
107
108     ml-search.py [-i/-I] [-t/-s/-f] 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]
109
110 Search and print a list of books by title, series, archive or file name.
111
112 Options::
113
114     -t, --title title      Search by title
115     -s, --series series    Search by series
116     -a, --archive archive  Search by archive (zip file)
117     -f, --file file        Search by file name (without extension)
118     --id id                Search by database id
119     --surname surname      Search by author’s surname
120     --name name            Search by author’s name
121     --misc-name misc. name Search by author’s misc. name
122     --fullname name        Search by author’s full name
123     --aid aid              Search by author’s id
124     -e, --ext ext          Search by file extension
125     --eid eid              Search by extension’s id
126     --gname name           Search by genre’s name
127     --gtitle title         Search by genre’s title
128     --gid gid              Search by genre’s id
129     -l, --lang lang        Search by language
130     --lid lid              Search by language’s id
131
132 By default the program prints only titles of the found book. With one
133 option `-d` it also prints database id, the list of authors and genres,
134 and also series the book belongs to (if any) and the serial number of
135 the book in the series. With two options `-d` (`-d -d` or simply `-dd`)
136 it also prints the file date and language. With three `-d` it prints
137 archive name, file name, extension and size, and flag if the book is
138 marked to be deleted.
139
140
141 Extension search
142 ^^^^^^^^^^^^^^^^
143
144 Usage::
145
146     ml-search.py [-i/-I] [-t/-s/-f] ext [name] [--id id]
147
148 Options::
149
150     --id id                Search by database id
151
152 Search and print a list of extensions by name.
153
154 With one option `-d` it also prints database id.
155
156
157 Genres search
158 ^^^^^^^^^^^^^
159
160 Usage::
161
162     ml-search.py [-i/-I] [-t/-s/-f] genres [-n name] [-t title] [--id id]
163
164 Search and print a list of genres by name and title.
165
166 Options::
167
168     -n, --name name    Search by name
169     -t, --title title  Search by title
170     --id id            Search by database id
171
172 With one option `-d` it also prints database id.
173
174
175 Language search
176 ^^^^^^^^^^^^^^^
177
178 Usage::
179
180     ml-search.py [-i/-I] [-t/-s/-f] lang [name] [--id id]
181
182 Search and print a list of languages by name.
183
184 Options::
185
186     --id id                Search by database id
187
188 With one option `-d` it also prints database id.
189
190 .. vim: set tw=72 :