Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mbdevpl committed Oct 23, 2024
1 parent f56d78b commit 57348d0
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Using
Installing *system-query* doesn't enable all the features by default. Some of the query functions
will work only on **some** systems. To attempt installation with all features enables,
run :bash:`pip3 install system-query[all]`. If something brakes, you can narrow down the features
by typing a feature scope instead of :bash:`all`.
You can choose from :bash:`cpu`, :bash:`gpu`, :bash:`hdd`, :bash:`ram` and :bash:`swap`.
by typing a feature scope instead of ``all``.
You can choose from ``cpu``, ``gpu``, ``hdd``, ``ram`` and ``swap``.
E.g. :bash:`pip3 install system-query[gpu]`. You can also select more than one feature
at the same time, e.g. :bash:`pip3 install system-query[cpu,hdd,ram]`.

Expand Down Expand Up @@ -140,13 +140,18 @@ assuming their executables are in system path.
system_query.query_swap()
~~~~~~~~~~~~~~~~~~~~~~~~~

To be able to see amount of swap space, install Python package :bash:`psutil`.
To be able to see amount of swap space, install Python package ``psutil``.

.. code:: python
In [9]: system_query.query_swap()
Out[9]: {'total': 0}
As command-line tool
--------------------

For example:
Below will run :python:`system_query.query_all()` and output results to stdout:

.. code:: bash
Expand All @@ -161,23 +166,23 @@ For example:
'host': 'TestMachine',
'os': 'Linux-4.4.0-109-generic-x86_64-with-debian-stretch-sid',
'ram': {'total': 33701269504},
'swap': 0}
'swap': {'total': 0}}
Usage information:
Please use ``-h`` to see usage information:

.. code::
$ python3 -m system_query -h
usage: system_query [-h] [-s {all,cpu,gpu,ram}] [-f {raw,json}] [-t TARGET]
[--version]
usage: system_query [-h] [-s {all,cpu,gpu,ram,swap}] [-f {raw,json}]
[-t TARGET] [--version]
Comprehensive and concise system information tool. Query a given hardware
and/or software scope of your system and get results in human- and machine-
readable formats.
optional arguments:
-h, --help show this help message and exit
-s {all,cpu,gpu,ram}, --scope {all,cpu,gpu,ram}
-s {all,cpu,gpu,ram,swap}, --scope {all,cpu,gpu,ram,swap}
Scope of the query (default: all)
-f {raw,json}, --format {raw,json}
Format of the results of the query. (default: raw)
Expand All @@ -187,6 +192,8 @@ Usage information:
stdout and stderr, respectively. (default: stdout)
--version show program's version number and exit
Copyright 2017-2023 by the contributors, Apache License 2.0,
https://github.com/mbdevpl/system-query
Requirements
============
Expand Down

0 comments on commit 57348d0

Please # to comment.