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