]> git.phdru.name Git - m_librarian.git/blob - docs/command_line.rst
Search genres by name and title
[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]
70
71 Search and print a list of authors by surname/name/misc 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 Extension search
95 ^^^^^^^^^^^^^^^^
96
97 Usage::
98
99     ml-search.py [-i] [-I] [-t ...] ext name
100
101 Search and print a list of extensions by name.
102
103 Genres search
104 ^^^^^^^^^^^^^
105
106 Usage::
107
108     ml-search.py [-i] [-I] [-t ...] genres [-n name] [-t title]
109
110 Search and print a list of genres by name and title.
111
112 Options::
113
114     -n, --name name    Search by name
115     -t, --title title  Search by title
116
117 .. vim: set tw=72 :