sphobjinv.cli.core¶
sphobjinv
CLI core execution module.
sphobjinv
is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
Brian Skinn (bskinn@alum.mit.edu)
- File Created
15 Nov 2020
- Copyright
(c) Brian Skinn 2016-2021
- Source Repository
- Documentation
- License
The MIT License; see LICENSE.txt for full license terms
Members
-
do_convert
(inv, in_path, params)¶ Carry out the conversion operation, including writing output.
If
OVERWRITE
is passed and the output file (the default location, or as passed toOUTFILE
) exists, it will be overwritten without a prompt. Otherwise, the user will be queried if it is desired to overwrite the existing file.If
QUIET
is passed, nothing will be printed to stdout (potentially useful for scripting), and any existing output file will be overwritten without prompting.
-
do_suggest
(inv, params)¶ Perform the suggest call and output the results.
Results are printed one per line.
If neither
INDEX
norSCORE
is specified, the results are output without a header. If either or both are specified, the results are output in a lightweight tabular format.If the number of results exceeds
SUGGEST_CONFIRM_LENGTH
, the user will be queried whether to display all of the returned results unlessALL
is specified.No -\-quiet option is available here, since a silent mode for suggestion output is nonsensical.
-
main
()¶ Handle command line invocation.
Parses command line arguments, handling the no-arguments and
VERSION
cases.Creates the
Inventory
from the indicated source and method.Invokes
do_convert()
ordo_suggest()
per the subparser name stored inSUBPARSER_NAME
.