Skip to content

Commit e4ca5ed

Browse files
committed
v0.0.28: fix org flag
1 parent 60438fa commit e4ca5ed

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

trust/audit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import (
1515
var CmdTrustAudit = cli.NewCmd[Audit](CmdTrust, "audit", func(cmd *cobra.Command) {
1616
cfg := cli.ConfigFromCmd(cmd)
1717

18-
cmd.Flags().StringVarP(&cfg.Trust.Org, "organization", "o", "", "Organization to trust.")
18+
cmd.Flags().StringVarP(&cfg.Trust.Org, "org", "o", "", "Organization to trust.")
1919
cmd.Flags().StringVarP(&cfg.Trust.Realm, "realm", "r", "", "Realm to trust.")
2020
cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", []string{"homebrew", "nss", "system"}, "Trust stores to update.")
2121

22-
cmd.MarkFlagsRequiredTogether("organization", "realm")
22+
cmd.MarkFlagsRequiredTogether("org", "realm")
2323
})
2424

2525
type Audit struct{}

trust/audit_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ func TestCmdTrustAudit(t *testing.T) {
2121
cmdtest.TestHelp(t, CmdTrustAudit, "trust", "audit", "--help")
2222
})
2323

24-
t.Run("--organization testOrg", func(t *testing.T) {
25-
err := cmdtest.TestError(t, CmdTrustAudit, "--organization", "testOrg")
26-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
24+
t.Run("--org testOrg", func(t *testing.T) {
25+
err := cmdtest.TestError(t, CmdTrustAudit, "--org", "testOrg")
26+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
2727
})
2828

2929
t.Run("-o testOrg", func(t *testing.T) {
3030
err := cmdtest.TestError(t, CmdTrustAudit, "-o", "testOrg")
31-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
31+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
3232
})
3333

3434
t.Run("-o testOrg -r testRealm", func(t *testing.T) {
@@ -39,12 +39,12 @@ func TestCmdTrustAudit(t *testing.T) {
3939

4040
t.Run("--realm testRealm", func(t *testing.T) {
4141
err := cmdtest.TestError(t, CmdTrustAudit, "--realm", "testRealm")
42-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
42+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
4343
})
4444

4545
t.Run("-r testRealm", func(t *testing.T) {
4646
err := cmdtest.TestError(t, CmdTrustAudit, "-r", "testRealm")
47-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
47+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
4848
})
4949

5050
t.Run("default --trust-stores", func(t *testing.T) {

trust/clean.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ var CmdTrustClean = cli.NewCmd[Clean](CmdTrust, "clean", func(cmd *cobra.Command
1717
cfg := cli.ConfigFromCmd(cmd)
1818

1919
cmd.Flags().StringSliceVar(&cfg.Trust.Clean.States, "cert-states", []string{"expired"}, "Cert states to clean.")
20-
cmd.Flags().StringVarP(&cfg.Trust.Org, "organization", "o", "", "Organization to trust.")
20+
cmd.Flags().StringVarP(&cfg.Trust.Org, "org", "o", "", "Organization to trust.")
2121
cmd.Flags().BoolVar(&cfg.Trust.NoSudo, "no-sudo", false, "Disable sudo prompts.")
2222
cmd.Flags().StringVarP(&cfg.Trust.Realm, "realm", "r", "", "Realm to trust.")
2323
cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", []string{"homebrew", "nss", "system"}, "Trust stores to update.")
2424

25-
cmd.MarkFlagsRequiredTogether("organization", "realm")
25+
cmd.MarkFlagsRequiredTogether("org", "realm")
2626

2727
cmd.Hidden = true
2828
})

trust/clean_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ func TestCmdTrustClean(t *testing.T) {
2020
require.Equal(t, []string{"all"}, cfg.Trust.Clean.States)
2121
})
2222

23-
t.Run("--organization testOrg", func(t *testing.T) {
24-
err := cmdtest.TestError(t, CmdTrustClean, "--organization", "testOrg")
25-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
23+
t.Run("--org testOrg", func(t *testing.T) {
24+
err := cmdtest.TestError(t, CmdTrustClean, "--org", "testOrg")
25+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
2626
})
2727

2828
t.Run("-o testOrg", func(t *testing.T) {
2929
err := cmdtest.TestError(t, CmdTrustClean, "-o", "testOrg")
30-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
30+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
3131
})
3232

3333
t.Run("-o testOrg -r testRealm", func(t *testing.T) {
@@ -38,12 +38,12 @@ func TestCmdTrustClean(t *testing.T) {
3838

3939
t.Run("--realm testRealm", func(t *testing.T) {
4040
err := cmdtest.TestError(t, CmdTrustClean, "--realm", "testRealm")
41-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
41+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
4242
})
4343

4444
t.Run("-r testRealm", func(t *testing.T) {
4545
err := cmdtest.TestError(t, CmdTrustClean, "-r", "testRealm")
46-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
46+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
4747
})
4848

4949
t.Run("default --trust-stores", func(t *testing.T) {

trust/testdata/TestCmdTrust/--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Available Commands:
1515
Flags:
1616
-h, --help help for trust
1717
--no-sudo Disable sudo prompts.
18-
-o, --organization string Organization to trust.
18+
-o, --org string Organization to trust.
1919
-r, --realm string Realm to trust.
2020
--trust-stores strings Trust stores to update. (default [homebrew,nss,system])
2121

trust/testdata/TestCmdTrustAudit/--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Usage:
1414

1515
Flags:
1616
-h, --help help for audit
17-
-o, --organization string Organization to trust.
17+
-o, --org string Organization to trust.
1818
-r, --realm string Realm to trust.
1919
--trust-stores strings Trust stores to update. (default [homebrew,nss,system])

trust/testdata/TestCmdTrustClean/--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Flags:
77
--cert-states strings Cert states to clean. (default [expired])
88
-h, --help help for clean
99
--no-sudo Disable sudo prompts.
10-
-o, --organization string Organization to trust.
10+
-o, --org string Organization to trust.
1111
-r, --realm string Realm to trust.
1212
--trust-stores strings Trust stores to update. (default [homebrew,nss,system])

trust/trust.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import (
2424
var CmdTrust = cli.NewCmd[Command](cli.CmdRoot, "trust", func(cmd *cobra.Command) {
2525
cfg := cli.ConfigFromCmd(cmd)
2626

27-
cmd.Flags().StringVarP(&cfg.Trust.Org, "organization", "o", "", "Organization to trust.")
27+
cmd.Flags().StringVarP(&cfg.Trust.Org, "org", "o", "", "Organization to trust.")
2828
cmd.Flags().BoolVar(&cfg.Trust.NoSudo, "no-sudo", false, "Disable sudo prompts.")
2929
cmd.Flags().StringVarP(&cfg.Trust.Realm, "realm", "r", "", "Realm to trust.")
3030
cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", []string{"homebrew", "nss", "system"}, "Trust stores to update.")
3131

32-
cmd.MarkFlagsRequiredTogether("organization", "realm")
32+
cmd.MarkFlagsRequiredTogether("org", "realm")
3333
})
3434

3535
type Command struct {

trust/trust_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ func TestCmdTrust(t *testing.T) {
4040
require.Equal(t, true, cfg.Trust.NoSudo)
4141
})
4242

43-
t.Run("--organization testOrg", func(t *testing.T) {
44-
err := cmdtest.TestError(t, CmdTrust, "--organization", "testOrg")
45-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
43+
t.Run("--org testOrg", func(t *testing.T) {
44+
err := cmdtest.TestError(t, CmdTrust, "--org", "testOrg")
45+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
4646
})
4747

4848
t.Run("-o testOrg", func(t *testing.T) {
4949
err := cmdtest.TestError(t, CmdTrust, "-o", "testOrg")
50-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [realm]")
50+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [realm]")
5151
})
5252

5353
t.Run("-o testOrg -r testRealm", func(t *testing.T) {
@@ -58,12 +58,12 @@ func TestCmdTrust(t *testing.T) {
5858

5959
t.Run("--realm testRealm", func(t *testing.T) {
6060
err := cmdtest.TestError(t, CmdTrust, "--realm", "testRealm")
61-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
61+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
6262
})
6363

6464
t.Run("-r testRealm", func(t *testing.T) {
6565
err := cmdtest.TestError(t, CmdTrust, "-r", "testRealm")
66-
require.ErrorContains(t, err, "if any flags in the group [organization realm] are set they must all be set; missing [organization]")
66+
require.ErrorContains(t, err, "if any flags in the group [org realm] are set they must all be set; missing [org]")
6767
})
6868

6969
t.Run("default --trust-stores", func(t *testing.T) {

0 commit comments

Comments
 (0)