]> git.phdru.name Git - m_librarian.git/blob - docs/command_line.rst
0fab06b7cac295396fc2594540b4e8be3d516144
[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] ...
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
50 Options ``-i/-I`` cannot be used together as they are the opposite. In
51 case none of them are used the program guesses case-sensitivity by
52 looking at the arguments. If all arguments are lowercase the program
53 performs case-insensitive search. If there are UPPERCASE or MixedCase
54 arguments the program performs case-sensitive search.
55
56 Options ``-t/-s/-f`` define the search type. Search types are:
57
58 * start - search for substring at the start of the search field; for
59   example searching for "duck" returns results for "duck" and "duckling"
60   but not for "McDuck"; this is the default search type.
61 * substring - search for any substring; "duck" => "duck", "duckling",
62   "McDuck" (except for case-sensitive search, of course).
63 * full - search for exact match, compare the entire strings;
64   i.e. searching for "duck" returns results for "duck" but not for
65   "duckling";
66
67
68 Author search
69 ^^^^^^^^^^^^^
70
71 Usage::
72
73     ml-search.py [-i/-I] [-t/-s/-f] author [-s surname] [-n name] [-m misc-name] [fullname]
74
75 Search and print a list of authors by surname/name/misc name/full name.
76
77 Options::
78
79     -s, --surname surname       Search by surname
80     -n, --name name             Search by name
81     -m, --misc-name misc. name  Search by misc. name
82
83 Example::
84
85     ml-search.py -i author -s duck
86
87 Search and print a list of authors whose surname starts with "duck",
88 case insensitive.
89
90 If a few options are given the search is limited with operator AND.
91 Example::
92
93     ml-search.py -i author -s duck -n mack
94
95 Search and print a list of authors whose surname starts with "duck" and
96 name starts with "mack", case insensitive.
97
98 With one option `-d` it also prints database id.
99
100
101 Book search
102 ^^^^^^^^^^^
103
104 Usage::
105
106     ml-search.py [-i/-I] [-t/-s/-f] books [-t title] [-s series] [-a archive] [-f file] [--surname name] [--name name] [--misc-name name] [--fullname name] [-e ext] [--gname name] [--gtitle title] [-l lang]
107
108 Search and print a list of books by title, series, archive or file name.
109
110 Options::
111
112     -t, --title title      Search by title
113     -s, --series series    Search by series
114     -a, --archive archive  Search by archive (zip file)
115     -f, --file file        Search by file name (without extension)
116     --surname surname      Search by author’s surname
117     --name name            Search by author’s name
118     --misc-name misc. name Search by author’s misc. name
119     --fullname name        Search by author’s full name
120     -e, --ext ext          Search by file extension
121     --gname name           Search by genre’s name
122     --gtitle title         Search by genre’s title
123     -l, --lang lang        Search by language
124
125 By default the program prints only titles of the found book. With one
126 option `-d` it also prints database id, the list of authors and genres,
127 and also series the book belongs to (if any) and the serial number of
128 the book in the series. With two options `-d` (`-d -d` or simply `-dd`)
129 it also prints the file date and language. With three `-d` it prints
130 archive name, file name, extension and size, and flag if the book is
131 marked to be deleted.
132
133
134 Extension search
135 ^^^^^^^^^^^^^^^^
136
137 Usage::
138
139     ml-search.py [-i/-I] [-t/-s/-f] ext [name]
140
141 Search and print a list of extensions by name.
142
143 With one option `-d` it also prints database id.
144
145
146 Genres search
147 ^^^^^^^^^^^^^
148
149 Usage::
150
151     ml-search.py [-i/-I] [-t/-s/-f] genres [-n name] [-t title]
152
153 Search and print a list of genres by name and title.
154
155 Options::
156
157     -n, --name name    Search by name
158     -t, --title title  Search by title
159
160 With one option `-d` it also prints database id.
161
162
163 Language search
164 ^^^^^^^^^^^^^^^
165
166 Usage::
167
168     ml-search.py [-i/-I] [-t/-s/-f] lang [name]
169
170 Search and print a list of languages by name.
171
172 With one option `-d` it also prints database id.
173
174 .. vim: set tw=72 :