The CLI for is implemented using two subparsers, one each for the convert <convert>
and suggest <suggest>
sub-functions. More information about the implementation of these features can be found here <implementation/index>
and in the documentation for the ~sphobjinv.inventory.Inventory
object, in particular the ~sphobjinv.inventory.Inventory.data_file
and ~sphobjinv.inventory.Inventory.suggest
methods.
Some notes on these CLI docs:
- CLI examples are executed in a sandboxed directory pre-loaded with objects_attrs.inv (from, e.g., here <https://github.com/bskinn/sphobjinv/blob/master/ tests/resource/objects_attrs.inv>__).
~pathlib.Path
(frompathlib
) is imported into the namespace before all tests.- cli_run is a helper function that enables doctesting of CLI examples by mimicking execution of a shell command. It is described in more detail here.
- file_head is a helper function that retrieves the head of a specified file.
sphobjinv
The options for the parent command are:
-h, --help
Show help message and exit
sphobjinv --help
-v, --version
Print package version & other info
sphobjinv --version
"convert" Mode <convert> "suggest" Mode <suggest>