Skip to content
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

Add a reference for available config keys in help & docs #1910

Merged
merged 8 commits into from Mar 8, 2023

Conversation

Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Mar 7, 2023

Fixes #1623

These changes add the available config keys to the config sub-command's --help and --full-help output (and thus, to the reference docs).
Only non-hidden (important for the average user) keys are listed in the short --help.

I also tweaked the config sub-command doc:

  • it will now be in the main commands website level
  • it's no longer a power command, so I fixed it not to be tagged as such

Short config help output:

scala-cli config -h
# Usage: scala-cli config [options]
# Configure global settings for Scala CLI.
# 
# Available keys:
#   actions                                        Globally enables actionable diagnostics. Enabled by default.
#   interactive                                    Globally enables interactive mode (the '--interactive' flag).
#   power                                          Globally enables power mode (the '--power' launcher flag).
#   suppress-warning.directives-in-multiple-files  Globally suppresses warnings about directives declared in multiple source files.
#   suppress-warning.outdated-dependencies-files   Globally suppresses warnings about outdated dependencies.
# 
# You are currently viewing the basic help for the config sub-command. You can view the full help by running: 
#    scala-cli config --help-full
# For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/config
# 
# Config options:
#   --unset, --remove  Remove an entry from config

Full config help output:

scala-cli config --full-help
# Usage: scala-cli config [options]
# Configure global settings for Scala CLI.
# 
# Syntax:
#   scala-cli config key value
# For example, to globally set the interactive mode:
#   scala-cli config interactive true
#   
# Available keys:
#   actions                                        Globally enables actionable diagnostics. Enabled by default.
#   github.token                                   (hidden) GitHub token.
#   httpProxy.address                              (hidden) HTTP proxy address.
#   httpProxy.password                             (hidden) HTTP proxy password (used for authentication).
#   httpProxy.user                                 (hidden) HTTP proxy user (used for authentication).
#   interactive                                    Globally enables interactive mode (the '--interactive' flag).
#   interactive-was-suggested                      (hidden) Setting indicating if the global interactive mode was already suggested.
#   pgp.public-key                                 (hidden) The PGP public key, used for signing.
#   pgp.secret-key                                 (hidden) The PGP secret key, used for signing.
#   pgp.secret-key-password                        (hidden) The PGP secret key password, used for signing.
#   power                                          Globally enables power mode (the '--power' launcher flag).
#   publish.credentials                            (hidden) Publishing credentials, syntax: s1.oss.sonatype.org value:user value:password
#   publish.user.email                             (hidden) The 'email' user detail, used for publishing.
#   publish.user.name                              (hidden) The 'name' user detail, used for publishing.
#   publish.user.url                               (hidden) The 'url' user detail, used for publishing.
#   repositories.credentials                       (hidden) Repository credentials, syntax: value:user value:password
#   repositories.default                           (hidden) Default repository, syntax: https://first-repo.company.com https://second-repo.company.com
#   repositories.mirrors                           (hidden) Repository mirrors, syntax: repositories.mirrors maven:*=https://repository.company.com/maven
#   suppress-warning.directives-in-multiple-files  Globally suppresses warnings about directives declared in multiple source files.
#   suppress-warning.outdated-dependencies-files   Globally suppresses warnings about outdated dependencies.
# 
# For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/misc/config
# 
# Config options:
#   --dump             (hidden) Dump config DB as JSON
#   --unset, --remove  Remove an entry from config
#  (...)

@Gedochao Gedochao added documentation Improvements or additions to documentation help All the issues related to improving help outputs labels Mar 7, 2023
@Gedochao Gedochao force-pushed the config-keys-reference branch 3 times, most recently from 0546366 to 2dd762e Compare March 7, 2023 11:54
@Gedochao Gedochao changed the title Add a reference for available config keys in help & reference docs Add a reference for available config keys in help & docs Mar 7, 2023
@Gedochao Gedochao marked this pull request as ready for review March 7, 2023 12:41
…e consistent with `case-app` options' help
…`, while only showing others in `--full-help`
  - it's not a `power` command, fixed it not to be tagged as such
  - moved the doc to the core commands level, as it is now useful to the average user
  - added a reference to the available config keys in the doc
  - extra examples, misc fixes
Copy link
Contributor

@lwronski lwronski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gedochao Gedochao enabled auto-merge March 8, 2023 08:29
@Gedochao Gedochao merged commit 864e1a5 into VirtusLab:main Mar 8, 2023
@Gedochao Gedochao deleted the config-keys-reference branch March 8, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help All the issues related to improving help outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a table of references in the docs for the config sub-command
2 participants