Skip to content

Commit

Permalink
Switch environment flag from camelCase to kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardecook committed Jan 28, 2022
1 parent 682006f commit 0e85aa4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion commands/bosh.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package commands

type BoshCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
2 changes: 1 addition & 1 deletion commands/cf_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

type CFLoginCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
2 changes: 1 addition & 1 deletion commands/om.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package commands

type OMCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
2 changes: 1 addition & 1 deletion commands/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

type OpenCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`
Show bool `short:"s" long:"show" description:"only show the credentials"`

Expand Down
2 changes: 1 addition & 1 deletion commands/pks_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

type PKSLoginCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
6 changes: 3 additions & 3 deletions commands/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func (e *environmentName) UnmarshalFlag(name string) error {

type SSHCommand struct {
TargetConfig targetConfigPath `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName environmentName `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName environmentName `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
Director SSHDirectorCommand `command:"director"`
OpsManager SSHOpsManagerCommand `command:"opsman"`
}

type SSHDirectorCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand All @@ -61,7 +61,7 @@ func (c *SSHDirectorCommand) Execute(args []string) error {

type SSHOpsManagerCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
2 changes: 1 addition & 1 deletion commands/sshuttle.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package commands

type SshuttleCommand struct {
TargetConfig string `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" hidden:"true"`
EnvironmentName string `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
EnvironmentName string `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" hidden:"true"`
File bool `short:"f" long:"file" description:"write a script file but do not run it"`

Env EnvReader
Expand Down
12 changes: 6 additions & 6 deletions integration/base_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ var _ = Describe("CLI", func() {
Say(`Usage:`),
Say(`hammer \[OPTIONS\] <command>`),
Say(`Application Options:`),
Say(`-t, --target= path to the target environment config`),
Say(`-e, --environmentName= name of the environment in the config to target`),
Say(`-t, --target= path to the target environment config`),
Say(`-e, --environment-name= name of the environment in the config to target`),
Say(`Help Options:`),
Say(`-h, --help Show this help message`),
Say(`-h, --help Show this help message`),
Say(`Available commands:`),
Say(`bosh display BOSH credentials, or run a BOSH command`),
Say(`cf-login log in to the cf for the environment`),
Expand All @@ -61,10 +61,10 @@ var _ = Describe("CLI", func() {
Say(`Usage:`),
Say(`hammer \[OPTIONS\] <command>`),
Say(`Application Options:`),
Say(`-t, --target= path to the target environment config`),
Say(`-e, --environmentName= name of the environment in the config to target`),
Say(`-t, --target= path to the target environment config`),
Say(`-e, --environment-name= name of the environment in the config to target`),
Say(`Help Options:`),
Say(`-h, --help Show this help message`),
Say(`-h, --help Show this help message`),
Say(`Available commands:`),
Say(`bosh display BOSH credentials, or run a BOSH command`),
Say(`cf-login log in to the cf for the environment`),
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type options struct {
Version versionCommand `command:"version" alias:"ver" description:"version of command"`
Completion commands.CompletionCommand `command:"completion" description:"command completion script"`
TargetConfig targetConfigPath `short:"t" long:"target" env:"HAMMER_TARGET_CONFIG" description:"path to the target environment config"`
EnvironmentName environmentName `short:"e" long:"environmentName" env:"HAMMER_ENVIRONMENT_NAME" description:"name of the environment in the config to target"`
EnvironmentName environmentName `short:"e" long:"environment-name" env:"HAMMER_ENVIRONMENT_NAME" description:"name of the environment in the config to target"`
}

func main() {
Expand Down

0 comments on commit 0e85aa4

Please sign in to comment.