Skip to content

Commit

Permalink
docs: improve documentation for cli actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Aug 23, 2024
1 parent 64a9aac commit e49271c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ It is possible to end up with an unusable system, for example by having no
way to do a mouse left click, so exercise caution when remapping keys or
buttons that are needed to operate your system.

## Solaar command line interface
## Solaar command-line interface

Solaar also has a command line interface that can do most of what can be
Solaar also has a command-line interface that can do most of what can be
done using the main window. For more information on the
command line interface, run `solaar --help` to see the commands and
then `solaar <command> --help` to see the arguments to any of the commands.
Expand Down
2 changes: 1 addition & 1 deletion lib/solaar/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _create_parser():
parser = argparse.ArgumentParser(
prog=NAME.lower(), add_help=False, epilog=f"For details on individual actions, run `{NAME.lower()} <action> --help`."
)
subparsers = parser.add_subparsers(title="actions", help="optional action to perform")
subparsers = parser.add_subparsers(title="actions", help="command-line action to perform")

sp = subparsers.add_parser("show", help="show information about devices")
sp.add_argument(
Expand Down
9 changes: 7 additions & 2 deletions lib/solaar/gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ def _parse_arguments():
)
arg_parser.add_argument("--tray-icon-size", type=int, help="explicit size for tray icons")
arg_parser.add_argument("-V", "--version", action="version", version="%(prog)s " + __version__)
arg_parser.add_argument("--help-actions", action="store_true", help="print help for the optional actions")
arg_parser.add_argument("action", nargs=argparse.REMAINDER, choices=cli.actions, help="optional actions to perform")
arg_parser.add_argument("--help-actions", action="store_true", help="describe the command-line actions")
arg_parser.add_argument(
"action",
nargs=argparse.REMAINDER,
choices=cli.actions,
help="command-line action to perform (optional); append ' --help' to show args",
)

args = arg_parser.parse_args()

Expand Down

0 comments on commit e49271c

Please sign in to comment.