devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
7 stars 18 forks source link

Display tool usage information when calling detailed help with 'ide help <tool>' #396

Closed slskiba closed 14 hours ago

slskiba commented 2 weeks ago

A tool's command line help should be displayed when calling detailed help with ide help <tool> (and the tool is already installed for the project), to provide the user with usage information specific to the tool.

For example, for docker, currently the detailed help that has been added in #389, provides the following output: (detailed help is yet to written, "TODO docker" serves as a placeholder)

ide> help docker
__       ___ ___  ___
\ \     |_ _|   \| __|__ _ ____ _
 > >     | || |) | _|/ _` (_-< || |
/_/ ___ |___|___/|___\__,_/__/\_, |
   |___|                       |__/

Current version of IDE is SNAPSHOT
Usage: ide [option]* docker [<args>*]
Tool commandlet for Docker.
TODO docker

Values:
<args>  The commandline arguments to pass to the tool.

Options:
--locale        the locale (e.g. '--locale=de' for German language).
-b | --batch    enable batch mode (non-interactive).
-d | --debug    enable debug logging.
-f | --force    enable force mode.
-o | --offline  enable offline mode (skip updates or git pull, fail downloads or git clone).
-q | --quiet    disable info logging (only log success, warning or error).
-t | --trace    enable trace logging.

Additionally to this, detailed help should print the tool's usage help, which is given by:

> docker --help

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Common Commands:
  run         Create and run a new container from an image
  exec        Execute a command in a running container
  ps          List containers
  build       Build an image from a Dockerfile
  pull        Download an image from a registry
  push        Upload an image to a registry
[...]