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

#396 Display the tools help output on 'ide help <tool>' #434

Closed slskiba closed 13 hours ago

slskiba commented 4 days ago

Resolves #396.

While initially #396 sounded like a great idea, it might be troublesome in practice. Taking for example aws, aws help prints an incredibly long list of services (380+) to use with the aws cli, cluttering the output immensly.

I therefore suggest the following solution to this issue:

Example output for ide help aws:

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

Current version of IDE is SNAPSHOT
Usage: ide [option]* aws [<args>*]
Tool commandlet for AWS CLI.
The AWS Command Line Interface (AWS CLI) is an open source tool for managing AWS resources. Detailed documentation can be found at https://docs.aws.amazon.com/cli/

Values:
<args>  The commandline arguments to pass to the tool.
To get detailed help about the usage of the AWS CLI, use "aws help"

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.

Example output for ide help gh:

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

Current version of IDE is SNAPSHOT
Usage: ide [option]* gh [<args>*]
Tool commandlet for GitHub CLI.
GitHub CLI (Command Line Interface) allows to interact with GitHub repositories, issues, and pull requests from the command line. Detailed documentation can be found at https://cli.github.com/manual/

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

Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  auth:        Authenticate gh and git with GitHub
  browse:      Open the repository in the browser
  codespace:   Connect to and manage codespaces
  gist:        Manage gists
  issue:       Manage issues
  org:         Manage organizations
  pr:          Manage pull requests
  project:     Work with GitHub Projects.
  release:     Manage releases
  repo:        Manage repositories

GITHUB ACTIONS COMMANDS
  cache:       Manage GitHub Actions caches
  run:         View details about workflow runs
  workflow:    View details about GitHub Actions workflows

ALIAS COMMANDS
  co:          Alias for "pr checkout"

ADDITIONAL COMMANDS
  alias:       Create command shortcuts
  api:         Make an authenticated GitHub API request
  attestation: Work with artifact attestations
  completion:  Generate shell completion scripts
  config:      Manage configuration for gh
  extension:   Manage gh extensions
  gpg-key:     Manage GPG keys
  label:       Manage labels
  ruleset:     View info about repo rulesets
  search:      Search for repositories, issues, and pull requests
  secret:      Manage GitHub secrets
  ssh-key:     Manage SSH keys
  status:      Print information about relevant issues, pull requests, and notifications across repositories
  variable:    Manage GitHub Actions variables

HELP TOPICS
  actions:     Learn about working with GitHub Actions
  environment: Environment variables that can be used with gh
  exit-codes:  Exit codes used by gh
  formatting:  Formatting options for JSON data exported from gh
  mintty:      Information about using gh with MinTTY
  reference:   A comprehensive reference of all gh commands

FLAGS
  --help      Show help for command
  --version   Show gh version

EXAMPLES
  $ gh issue create
  $ gh repo clone cli/cli
  $ gh pr checkout 321

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

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.
coveralls commented 4 days ago

Pull Request Test Coverage Report for Build 9743644633

Details


Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/docker/Docker.java 1 4.76%
com/devonfw/tools/ide/tool/gh/Gh.java 1 66.67%
com/devonfw/tools/ide/tool/aws/Aws.java 2 5.71%
com/devonfw/tools/ide/commandlet/HelpCommandlet.java 2 93.37%
com/devonfw/tools/ide/tool/ToolCommandlet.java 5 69.93%
<!-- Total: 11 -->
Totals Coverage Status
Change from base Build 9708861274: -0.05%
Covered Lines: 4994
Relevant Lines: 7974

πŸ’› - Coveralls
coveralls commented 4 days ago

Pull Request Test Coverage Report for Build 9743646050

Details


Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/docker/Docker.java 1 4.76%
com/devonfw/tools/ide/tool/gh/Gh.java 1 66.67%
com/devonfw/tools/ide/tool/aws/Aws.java 2 5.71%
com/devonfw/tools/ide/commandlet/HelpCommandlet.java 2 93.37%
com/devonfw/tools/ide/tool/ToolCommandlet.java 3 70.92%
<!-- Total: 9 -->
Totals Coverage Status
Change from base Build 9708861274: -0.03%
Covered Lines: 4994
Relevant Lines: 7972

πŸ’› - Coveralls
coveralls commented 3 days ago

Pull Request Test Coverage Report for Build 9759176562

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/terraform/Terraform.java 1 33.33%
com/devonfw/tools/ide/tool/helm/Helm.java 1 66.67%
com/devonfw/tools/ide/tool/docker/Docker.java 1 4.76%
com/devonfw/tools/ide/tool/gradle/Gradle.java 1 40.0%
com/devonfw/tools/ide/tool/gh/Gh.java 1 66.67%
com/devonfw/tools/ide/tool/dotnet/DotNet.java 1 66.67%
com/devonfw/tools/ide/tool/kotlinc/Kotlinc.java 1 66.67%
com/devonfw/tools/ide/tool/oc/Oc.java 1 66.67%
com/devonfw/tools/ide/tool/npm/Npm.java 1 95.65%
com/devonfw/tools/ide/tool/quarkus/Quarkus.java 1 66.67%
<!-- Total: 23 -->
Totals Coverage Status
Change from base Build 9708861274: -0.02%
Covered Lines: 4996
Relevant Lines: 7981

πŸ’› - Coveralls
coveralls commented 2 days ago

Pull Request Test Coverage Report for Build 9778567475

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/terraform/Terraform.java 1 33.33%
com/devonfw/tools/ide/tool/helm/Helm.java 1 66.67%
com/devonfw/tools/ide/tool/docker/Docker.java 1 4.76%
com/devonfw/tools/ide/tool/gradle/Gradle.java 1 40.0%
com/devonfw/tools/ide/tool/gh/Gh.java 1 66.67%
com/devonfw/tools/ide/tool/dotnet/DotNet.java 1 66.67%
com/devonfw/tools/ide/tool/kotlinc/Kotlinc.java 1 66.67%
com/devonfw/tools/ide/tool/oc/Oc.java 1 66.67%
com/devonfw/tools/ide/tool/npm/Npm.java 1 95.65%
com/devonfw/tools/ide/tool/quarkus/Quarkus.java 1 66.67%
<!-- Total: 56 -->
Totals Coverage Status
Change from base Build 9708861274: 0.3%
Covered Lines: 5147
Relevant Lines: 8177

πŸ’› - Coveralls
jan-vcapgemini commented 1 day ago

If possible, please add a simple test to increase the test coverage here too. Just a check for a tool starting its simulated help command if it was found should suffice I guess.

coveralls commented 13 hours ago

Pull Request Test Coverage Report for Build 9808878877

Details


Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/terraform/Terraform.java 1 33.33%
com/devonfw/tools/ide/tool/helm/Helm.java 1 66.67%
com/devonfw/tools/ide/tool/docker/Docker.java 1 4.76%
com/devonfw/tools/ide/tool/gradle/Gradle.java 1 80.0%
com/devonfw/tools/ide/tool/gh/Gh.java 1 66.67%
com/devonfw/tools/ide/tool/dotnet/DotNet.java 1 66.67%
com/devonfw/tools/ide/tool/kotlinc/Kotlinc.java 1 66.67%
com/devonfw/tools/ide/tool/oc/Oc.java 1 66.67%
com/devonfw/tools/ide/tool/npm/Npm.java 1 95.65%
com/devonfw/tools/ide/tool/quarkus/Quarkus.java 1 66.67%
<!-- Total: 68 -->
Totals Coverage Status
Change from base Build 9808498015: -0.04%
Covered Lines: 5276
Relevant Lines: 8226

πŸ’› - Coveralls