Skip to content

Commit

Permalink
chore: update CLI docs now that thor prints out the default for boole…
Browse files Browse the repository at this point in the history
…ans in the help
  • Loading branch information
bethesque committed Nov 9, 2023
1 parent abc8ea3 commit 222edf5
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 35 deletions.
89 changes: 61 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,23 @@ Options:
URL from known CI environment variables or git CLI. Supports
Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins,
Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps.
# Default: false
-t, [--tag=TAG]
# Tag name for consumer version. Can be specified multiple
times.
-g, [--tag-with-git-branch], [--no-tag-with-git-branch]
# Tag consumer version with the name of the current git branch.
Supports Buildkite, Circle CI, Travis CI, GitHub Actions,
Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and
Azure DevOps. Default: false
Azure DevOps.
# Default: false
[--build-url=BUILD_URL]
# The build URL that created the pact
[--merge], [--no-merge]
# If a pact already exists for this consumer version and
provider, merge the contents. Useful when running Pact tests
concurrently on different build nodes.
# Default: false
-o, [--output=OUTPUT]
# json or text
# Default: text
Expand All @@ -97,7 +100,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Publish pacts to a Pact Broker.
Expand All @@ -118,7 +122,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
-o, [--output=OUTPUT]
# json or table
# Default: table
Expand All @@ -142,7 +147,8 @@ Options:
# The display name of the environment
[--production], [--no-production]
# Whether or not this environment is a production environment.
This is currently informational only. Default: false
This is currently informational only.
# Default: false
[--contact-name=CONTACT_NAME]
# The name of the team/person responsible for this environment
[--contact-email-address=CONTACT_EMAIL_ADDRESS]
Expand All @@ -160,7 +166,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Create an environment resource in the Pact Broker to represent a real world deployment or release environment.
Expand All @@ -181,7 +188,8 @@ Options:
# The display name of the environment
[--production], [--no-production]
# Whether or not this environment is a production environment.
This is currently informational only. Default: false
This is currently informational only.
# Default: false
[--contact-name=CONTACT_NAME]
# The name of the team/person responsible for this environment
[--contact-email-address=CONTACT_EMAIL_ADDRESS]
Expand All @@ -199,7 +207,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Update an environment resource in the Pact Broker.
Expand All @@ -225,7 +234,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Describe an environment
Expand All @@ -251,7 +261,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Delete an environment
Expand All @@ -275,7 +286,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

List environments
Expand Down Expand Up @@ -316,7 +328,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Record deployment of a pacticipant version to an environment. See https://docs.pact.io/record-deployment for more information.
Expand Down Expand Up @@ -356,7 +369,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Description:
Expand Down Expand Up @@ -392,7 +406,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Record release of a pacticipant version to an environment. See See https://docs.pact.io/record-release for more information.
Expand Down Expand Up @@ -422,7 +437,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Record the end of support for a pacticipant version in an environment. See https://docs.pact.io/record-support-ended for more information.
Expand Down Expand Up @@ -459,6 +475,7 @@ Options:
# Use the latest version of the configured main branch of the
pacticipant as the version for which you want to check the
verification results
# Default: false
[--to-environment=ENVIRONMENT]
# The environment into which the pacticipant(s) are to be
deployed
Expand Down Expand Up @@ -488,6 +505,7 @@ Options:
is recommended to use the environment variable and just set it
for the build required to deploy that particular version, so
you don't accidentally leave the dry run mode enabled.
# Default: false
-b, --broker-base-url=BROKER_BASE_URL
# The base URL of the Pact Broker
-u, [--broker-username=BROKER_USERNAME]
Expand All @@ -497,7 +515,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Description:
Expand Down Expand Up @@ -575,6 +594,7 @@ Options:
is recommended to use the environment variable and just set it
for the build required to deploy that particular version, so
you don't accidentally leave the dry run mode enabled.
# Default: false
-b, --broker-base-url=BROKER_BASE_URL
# The base URL of the Pact Broker
-u, [--broker-username=BROKER_USERNAME]
Expand All @@ -584,7 +604,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Description:
Expand Down Expand Up @@ -619,7 +640,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Create or update pacticipant by name
Expand All @@ -645,7 +667,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Describe a pacticipant
Expand All @@ -669,7 +692,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

List pacticipants
Expand Down Expand Up @@ -731,7 +755,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Description:
Expand Down Expand Up @@ -796,7 +821,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
--uuid=UUID
# Specify the uuid for the webhook
```
Expand Down Expand Up @@ -827,7 +853,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Test the execution of a webhook
Expand All @@ -850,10 +877,12 @@ Options:
times.
[--auto-create-version], [--no-auto-create-version]
# Automatically create the pacticipant version if it does not
exist. Default: false
exist.
# Default: false
-g, [--tag-with-git-branch], [--no-tag-with-git-branch]
# Tag pacticipant version with the name of the current git
branch. Default: false
branch.
# Default: false
-b, --broker-base-url=BROKER_BASE_URL
# The base URL of the Pact Broker
-u, [--broker-username=BROKER_USERNAME]
Expand All @@ -863,7 +892,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Add a tag to a pacticipant version
Expand Down Expand Up @@ -896,7 +926,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Describes a pacticipant version. If no version or tag is specified, the latest version is described.
Expand Down Expand Up @@ -926,7 +957,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
-o, [--output=OUTPUT]
# json or text
# Default: text
Expand Down Expand Up @@ -1002,7 +1034,8 @@ Options:
-k, [--broker-token=BROKER_TOKEN]
# Pact Broker bearer token
-v, [--verbose], [--no-verbose]
# Verbose output. Default: false
# Verbose output.
# Default: false
```

Publish provider contract to PactFlow
Expand Down
4 changes: 2 additions & 2 deletions lib/pact_broker/client/cli/custom_thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ def self.shared_authentication_options
method_option :broker_username, aliases: "-u", desc: "Pact Broker basic auth username"
method_option :broker_password, aliases: "-p", desc: "Pact Broker basic auth password"
method_option :broker_token, aliases: "-k", desc: "Pact Broker bearer token"
method_option :verbose, aliases: "-v", type: :boolean, default: false, required: false, desc: "Verbose output. Default: false"
method_option :verbose, aliases: "-v", type: :boolean, default: false, required: false, desc: "Verbose output."
end

def self.verbose_option
method_option :verbose, aliases: "-v", type: :boolean, default: false, required: false, desc: "Verbose output. Default: false"
method_option :verbose, aliases: "-v", type: :boolean, default: false, required: false, desc: "Verbose output."
end

def self.output_option_json_or_text
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/client/cli/environment_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.included(thor)
def self.shared_environment_options(name_required: false)
method_option :name, required: name_required, desc: "The uniquely identifying name of the environment as used in deployment code"
method_option :display_name, desc: "The display name of the environment"
method_option :production, type: :boolean, default: false, desc: "Whether or not this environment is a production environment. This is currently informational only. Default: false"
method_option :production, type: :boolean, default: false, desc: "Whether or not this environment is a production environment. This is currently informational only."
method_option :contact_name, required: false, desc: "The name of the team/person responsible for this environment"
method_option :contact_email_address, required: false, desc: "The email address of the team/person responsible for this environment"
output_option_json_or_text
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/client/cli/pact_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.included(thor)
method_option :branch, aliases: "-h", desc: "Repository branch of the consumer version"
method_option :auto_detect_version_properties, aliases: "-r", type: :boolean, default: false, desc: "Automatically detect the repository commit, branch and build URL from known CI environment variables or git CLI. Supports Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps."
method_option :tag, aliases: "-t", type: :array, banner: "TAG", desc: "Tag name for consumer version. Can be specified multiple times."
method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag consumer version with the name of the current git branch. Supports Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps. Default: false"
method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag consumer version with the name of the current git branch. Supports Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps."
method_option :build_url, desc: "The build URL that created the pact"
method_option :merge, type: :boolean, default: false, require: false, desc: "If a pact already exists for this consumer version and provider, merge the contents. Useful when running Pact tests concurrently on different build nodes."
output_option_json_or_text
Expand Down
4 changes: 2 additions & 2 deletions lib/pact_broker/client/cli/version_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def create_or_update_version(*required_but_ignored)
method_option :pacticipant, required: true, aliases: "-a", desc: "The pacticipant name"
method_option :version, required: true, aliases: "-e", desc: "The pacticipant version"
method_option :tag, aliases: "-t", type: :array, banner: "TAG", desc: "Tag name for pacticipant version. Can be specified multiple times."
method_option :auto_create_version, type: :boolean, default: false, desc: "Automatically create the pacticipant version if it does not exist. Default: false"
method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag pacticipant version with the name of the current git branch. Default: false"
method_option :auto_create_version, type: :boolean, default: false, desc: "Automatically create the pacticipant version if it does not exist."
method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag pacticipant version with the name of the current git branch."
shared_authentication_options

def create_version_tag
Expand Down
2 changes: 1 addition & 1 deletion lib/pactflow/client/cli/provider_contract_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.included(thor)
method_option :branch, aliases: "-h", desc: "Repository branch of the provider version"
#method_option :auto_detect_version_properties, hidden: true, type: :boolean, default: false, desc: "Automatically detect the repository branch from known CI environment variables or git CLI."
method_option :tag, aliases: "-t", type: :array, banner: "TAG", desc: "Tag name for provider version. Can be specified multiple times."
#method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag consumer version with the name of the current git branch. Default: false"
#method_option :tag_with_git_branch, aliases: "-g", type: :boolean, default: false, required: false, desc: "Tag consumer version with the name of the current git branch."
method_option :specification, default: "oas", desc: "The contract specification"
method_option :content_type, desc: "The content type. eg. application/yml"
method_option :verification_success, type: :boolean, desc: "Whether or not the self verification passed successfully."
Expand Down

0 comments on commit 222edf5

Please sign in to comment.