-
Notifications
You must be signed in to change notification settings - Fork 229
Generate CLI documentation using sphinx with autoprogram #1767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jonrebm
wants to merge
7
commits into
labgrid-project:master
Choose a base branch
from
jonrebm:sphinx_autoprogram
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e818012
doc/conf: avoid name conflict for `version`
jonrebm a963d77
man: Migrate to doc/
jonrebm eae6a00
remote/client: separate ArgumentParser() definition
jonrebm 9a4affc
doc: man: Generate labgrid-client manpage using autoprogram
jonrebm 2e41e03
doc: Limit toc depth to 2 on manpage overview
jonrebm 81ea5e3
remote/client: sphinx autoprogram workarounds
jonrebm 45ae505
doc: man: Add some details to subcommands
jonrebm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,134 @@ | ||
| .. _labgrid-client: | ||
| .. include:: ../../man/labgrid-client.rst | ||
|
|
||
| labgrid-client CLI | ||
Bastian-Krause marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ================== | ||
|
|
||
| Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems. | ||
|
|
||
| This is the client to control a boards status and interface with it on remote machines. | ||
|
|
||
| .. currentmodule:: labgrid.remote.client | ||
|
|
||
|
|
||
| .. autoprogram:: labgrid.remote.client:get_parser(auto_doc_mode=True) | ||
| :prog: labgrid-client | ||
|
|
||
| Configuration File | ||
| ------------------ | ||
| The configuration file follows the description in ``labgrid-device-config``\(5). | ||
|
|
||
| Environment Variables | ||
| --------------------- | ||
| Various labgrid-client commands use the following environment variable: | ||
|
|
||
| LG_PLACE | ||
| ~~~~~~~~ | ||
| This variable can be used to specify a place without using the ``-p`` option, the ``-p`` option overrides it. | ||
|
|
||
| LG_TOKEN | ||
| ~~~~~~~~ | ||
| This variable can be used to specify a reservation for the ``wait`` command and | ||
| for the ``+`` place expansion. | ||
|
|
||
| LG_STATE | ||
| ~~~~~~~~ | ||
| This variable can be used to specify a state which the device transitions into | ||
| before executing a command. Requires a configuration file and a Strategy | ||
| specified for the device. | ||
|
|
||
| LG_INITIAL_STATE | ||
| ~~~~~~~~~~~~~~~~ | ||
| This variable can be used to specify an initial state the device is known to | ||
| be in. | ||
| This is useful during development. The Strategy used must implement the | ||
| ``force()`` method. | ||
| A desired state must be set using ``LG_STATE`` or ``-s``/``--state``. | ||
|
|
||
| LG_ENV | ||
| ~~~~~~ | ||
| This variable can be used to specify the configuration file to use without | ||
| using the ``--config`` option, the ``--config`` option overrides it. | ||
|
|
||
| LG_COORDINATOR | ||
| ~~~~~~~~~~~~~~ | ||
| This variable can be used to set the default coordinator in the format | ||
| ``HOST[:PORT]`` (instead of using the ``-x`` option). | ||
|
|
||
| LG_PROXY | ||
| ~~~~~~~~ | ||
| This variable can be used to specify a SSH proxy hostname which should be used | ||
| to connect to the coordinator and any resources which are normally accessed | ||
| directly. | ||
|
|
||
| LG_HOSTNAME | ||
| ~~~~~~~~~~~ | ||
| Override the hostname used when accessing a resource. Typically only useful for | ||
| CI pipelines where the hostname may not be consistent between pipeline stages. | ||
|
|
||
| LG_USERNAME | ||
| ~~~~~~~~~~~ | ||
| Override the username used when accessing a resource. Typically only useful for | ||
| CI pipelines where the username may not be consistent between pipeline stages. | ||
|
|
||
| LG_SSH_CONNECT_TIMEOUT | ||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||
| Set the connection timeout when using SSH (The ``ConnectTimeout`` option). If | ||
| unspecified, defaults to 30 seconds. | ||
|
|
||
| LG_AGENT_PREFIX | ||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||
| Add a prefix to ``.labgrid_agent_{agent_hash}.py`` allowing specification for | ||
| where on the exporter it should be uploaded to. | ||
|
|
||
| Matches | ||
| ------- | ||
| Match patterns are used to assign a resource to a specific place. The format is: | ||
| exporter/group/cls/name, exporter is the name of the exporting machine, group is | ||
| a name defined within the exporter, cls is the class of the exported resource | ||
| and name is its name. Wild cards in match patterns are explicitly allowed, * | ||
| matches anything. | ||
|
|
||
| Adding Named Resources | ||
| ---------------------- | ||
| If a target contains multiple Resources of the same type, named matches need to | ||
| be used to address the individual resources. In addition to the *match* taken by | ||
| ``add-match``, ``add-named-match`` also takes a name for the resource. The other | ||
| client commands support the name as an optional parameter and will inform the | ||
| user that a name is required if multiple resources are found, but no name is | ||
| given. | ||
|
|
||
| If one of the resources should be used by default when no resource name is | ||
| explicitly specified, it can be named ``default``. | ||
|
|
||
| Examples | ||
| -------- | ||
|
|
||
| To retrieve a list of places run: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ labgrid-client places | ||
|
|
||
| To access a place, it needs to be acquired first, this can be done by running | ||
| the ``acquire command`` and passing the placename as a -p parameter: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ labgrid-client -p <placename> acquire | ||
|
|
||
| Open a console to the acquired place: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ labgrid-client -p <placename> console | ||
|
|
||
| Add all resources with the group "example-group" to the place example-place: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ labgrid-client -p example-place add-match */example-group/*/* | ||
|
|
||
| See Also | ||
| -------- | ||
|
|
||
| ``labgrid-exporter``\(1) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,34 @@ | ||
| .. _labgrid-coordinator: | ||
| .. include:: ../../man/labgrid-coordinator.rst | ||
| ===================== | ||
| labgrid-coordinator | ||
| ===================== | ||
|
|
||
| labgrid-coordinator managing labgrid resources and places | ||
| ========================================================= | ||
|
|
||
Bastian-Krause marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| SYNOPSIS | ||
| -------- | ||
|
|
||
| ``labgrid-coordinator`` ``--help`` | ||
|
|
||
| DESCRIPTION | ||
| ----------- | ||
| Labgrid is a scalable infrastructure and test architecture for embedded (linux) | ||
| systems. | ||
|
|
||
| This is the man page for the coordinator. Clients and exporters connect to the | ||
| coordinator to publish resources, manage place configuration and handle mutual | ||
| exclusion. | ||
|
|
||
| OPTIONS | ||
| ------- | ||
| -h, --help | ||
| display command line help | ||
| -l ADDRESS, --listen ADDRESS | ||
| make coordinator listen on host and port | ||
| -d, --debug | ||
| enable debug mode | ||
|
|
||
| SEE ALSO | ||
| -------- | ||
|
|
||
| ``labgrid-client``\(1), ``labgrid-exporter``\(1) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.