From: Oleg Broytman Date: Tue, 12 Apr 2016 17:55:13 +0000 (+0300) Subject: Describe global options for ml-search.py X-Git-Tag: 0.0.4~14 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=d398550525fda4c79d98c7db794d44ee366134ad Describe global options for ml-search.py --- diff --git a/docs-ru/command_line.rst b/docs-ru/command_line.rst index 44b30bd..ff2e544 100644 --- a/docs-ru/command_line.rst +++ b/docs-ru/command_line.rst @@ -26,4 +26,39 @@ INPX, перечисленных в командной строке. При по переинициализирует БД и не переимпортирует жанры; так же не переимпортирует уже проимпортированные книги, но импортирует в БД новые. + +ml-search.py +------------ + +Использование:: + + ml-search.py [-i] [-I] [-t {exact,start,substring}] ... + +Программа выполняет поиск по базе данных и показывает список +результатов. В настоящее время может искать только в списке авторов. + +Глобальные опции:: + + -i, --ignore-case независимо от регистра (по умолчанию: угадать) + -I, --case-sensitive с учётом регистра + -t, --search-type {exact,start,substring} + тип поиска: точный, подстрока в начале (это тип по умолчанию), + подстрока в любом месте. + +Опции ``-i/-I`` не могут использованы одновременно, поскольку означают +противоположные команды. В случае, если ни одна из них не использована, +программ угадывает зависимость от регистра: если все параметры даны в +нижнем регистре, программы выполнит поиск без учёта регистра. Если среди +параметров есть параметры в ВЕРХНЕМ или Смешанном регистре - поиск будет +с учётом регистра. + +Опция ``-t/--search-type`` определяет тип поиска. Возможные значения: + +* exact - поиск на точное совпадение; поиск "друг" найдёт только "друг", + но "другой"; +* start - поиск подстроки в начале поля; поиск "друг" найдёт "друг" и + "другой", но не "подруга"; это тип по умолчанию; +* substring - поиск подстроки в любом месте; поиск "друг" найдёт "друг", + "другой" и "подруга". + .. vim: set tw=72 : diff --git a/docs/command_line.rst b/docs/command_line.rst index 8f0e456..f3f2f58 100644 --- a/docs/command_line.rst +++ b/docs/command_line.rst @@ -25,4 +25,39 @@ Initialize database, import genres list and import a list of INPX files listed in the command line. On subsequent runs doesn't destroy DB or reimport genres; it also skips already import books but import new ones. + +ml-search.py +------------ + +Usage:: + + ml-search.py [-i] [-I] [-t {exact,start,substring}] ... + +Search through the database and display results. Currently can only +search authors by name. + +Global options:: + + -i, --ignore-case ignore case (default is to guess) + -I, --case-sensitive don't ignore case + -t, --search-type {exact,start,substring} + search type: exact match, substring at the start (this is the default), + substring anywhere. + +Options ``-i/-I`` cannot be used together as they are the opposite. In +case none of them are used the program guesses case-sensitivity by +looking at the arguments. If all arguments are lowercase the program +performs case-insensitive search. If there are UPPERCASE or MixedCase +arguments the program performs case-sensitive search. + +Option ``-t/--search-type`` defines the search type. Search types are: + +* exact - search for exact match; i.e. searching for "duck" returns + results for "duck" but not for "duckling"; +* start - search for substring at the start of the search field; for + example searching for "duck" returns results for "duck" and "duckling" + but not for "McDuck"; this is the default search type. +* substring - search for any substring; "duck" => "duck", "duckling", + "McDuck" (except for case-sensitive search, of course). + .. vim: set tw=72 :