]> git.phdru.name Git - m_librarian.git/blob - docs/command_line.rst
0e63d97acd8b1d72fd34510848b54ca9fcd15acf
[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. Doesn'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 {exact,start,substring}] ...
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, --search-type {exact,start,substring}
44         search type: exact match, substring at the start (this is the default),
45         substring anywhere.
46
47 Options ``-i/-I`` cannot be used together as they are the opposite. In
48 case none of them are used the program guesses case-sensitivity by
49 looking at the arguments. If all arguments are lowercase the program
50 performs case-insensitive search. If there are UPPERCASE or MixedCase
51 arguments the program performs case-sensitive search.
52
53 Option ``-t/--search-type`` defines the search type. Search types are:
54
55 * exact - search for exact match; i.e. searching for "duck" returns
56   results for "duck" but not for "duckling";
57 * start - search for substring at the start of the search field; for
58   example searching for "duck" returns results for "duck" and "duckling"
59   but not for "McDuck"; this is the default search type.
60 * substring - search for any substring; "duck" => "duck", "duckling",
61   "McDuck" (except for case-sensitive search, of course).
62
63
64 Author search
65 ^^^^^^^^^^^^^
66
67 Usage::
68
69     ml-search.py [-i] [-I] [-t ...] author [-s surname] [-n name] [-m misc-name] [fullname]
70
71 Search and print a list of authors by surname/name/misc name/full name.
72
73 Options::
74
75     -s, --surname surname       Search by surname
76     -n, --name name             Search by name
77     -m, --misc-name misc. name  Search by misc. name
78
79 Example::
80
81     ml-search.py -i author -s duck
82
83 Search and print a list of authors whose surname starts with "duck",
84 case insensitive.
85
86 If a few options are given the search is limited with operator AND.
87 Example::
88
89     ml-search.py -i author -s duck -n mack
90
91 Search and print a list of authors whose surname starts with "duck", and
92 name starts with "mack", case insensitive.
93
94 Book search
95 ^^^^^^^^^^^
96
97 Usage::
98
99     ml-search.py [-i] [-I] [-t ...] books [-t title] [-s series] [-a archive] [-f file] [-d]
100
101 Search and print a list of books by title, series, archive or file name.
102
103 Options::
104
105     -t, --title title      Search by title
106     -s, --series series    Search by series
107     -a, --archive archive  Search by archive (zip file)
108     -f, --file file        Search by file name (without extension)
109     -d, --details          Output more details about books;
110                            repeat for even more details
111
112 By default the program prints only titles of the found book. With one
113 option `-d` it also prints the list of authors.
114
115 Extension search
116 ^^^^^^^^^^^^^^^^
117
118 Usage::
119
120     ml-search.py [-i] [-I] [-t ...] ext [name]
121
122 Search and print a list of extensions by name.
123
124 Genres search
125 ^^^^^^^^^^^^^
126
127 Usage::
128
129     ml-search.py [-i] [-I] [-t ...] genres [-n name] [-t title]
130
131 Search and print a list of genres by name and title.
132
133 Options::
134
135     -n, --name name    Search by name
136     -t, --title title  Search by title
137
138 Language search
139 ^^^^^^^^^^^^^^^
140
141 Usage::
142
143     ml-search.py [-i] [-I] [-t ...] lang [name]
144
145 Search and print a list of languages by name.
146
147 .. vim: set tw=72 :