1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
.. Description of commandline usage
Command-Line Usage
==================
The CLI for |soi| is implemented using two subcommands:
- A :doc:`convert <convert>` subcommand, which handles conversion of
inventories between supported formats (currently zlib-compressed,
plaintext, and JSON).
- A :doc:`suggest <suggest>` subcommand, which provides suggestions for
objects in an inventory matching a desired search term.
More information about the underlying implementation of these subcommands can
be found :doc:`here <implementation/index>` and in the documentation for the
:class:`~sphobjinv.inventory.Inventory` object, in particular the
:meth:`~sphobjinv.inventory.Inventory.data_file` and
:meth:`~sphobjinv.inventory.Inventory.suggest` methods.
Some notes on these CLI docs:
* CLI docs examples are executed in a sandboxed directory pre-loaded with
|cour|\ objects_attrs.inv\ |/cour| (from, e.g.,
`here <https://github.com/bskinn/sphobjinv/blob/main/
tests/resource/objects_attrs.inv>`__).
* :class:`~pathlib.Path` (from :mod:`pathlib`)
is imported into the namespace before all tests.
* |cour|\ cli_run\ |/cour| is a helper function that enables doctesting
of CLI examples by mimicking execution of a shell command.
It is described in more detail
`here <https://bskinn.github.io/Testing-CLI-Scripts/>`__.
* |cour|\ file_head\ |/cour| is a helper function
that retrieves the head of a specified file.
.. program:: sphobjinv
The options for the parent |soi| command are:
.. option:: -h, --help
Show help message and exit
.. program-output:: sphobjinv --help
.. option:: -v, --version
Print package version & other info
.. program-output:: sphobjinv --version
.. toctree::
:maxdepth: 1
:hidden:
"convert" Mode <convert>
"suggest" Mode <suggest>
|