cmd/tailscale/cli: rename "--posture-checking" to "--report-posture"

For consistency with other flags, per Slack chat.

Updates #5902

Change-Id: I7ae1e4c97b37185573926f5fafda82cf8b46f071
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-05-05 13:24:41 -07:00
committed by Brad Fitzpatrick
parent 62182f3bcf
commit cf6a593196
6 changed files with 42 additions and 25 deletions
+19 -14
View File
@@ -605,7 +605,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
want: "",
},
{
name: "losing_posture_checking",
name: "losing_report_posture",
flags: []string{"--accept-dns"},
curPrefs: &ipn.Prefs{
ControlURL: ipn.DefaultControlURL,
@@ -615,7 +615,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
NetfilterMode: preftype.NetfilterOn,
NoStatefulFiltering: opt.NewBool(true),
},
want: accidentalUpPrefix + " --accept-dns --posture-checking",
want: accidentalUpPrefix + " --accept-dns --report-posture",
},
}
for _, tt := range tests {
@@ -1394,23 +1394,28 @@ var cmpIP = cmp.Comparer(func(a, b netip.Addr) bool {
})
func TestCleanUpArgs(t *testing.T) {
type S = []string
c := qt.New(t)
tests := []struct {
in []string
want []string
}{
{in: []string{"something"}, want: []string{"something"}},
{in: []string{}, want: []string{}},
{in: []string{"--authkey=0"}, want: []string{"--auth-key=0"}},
{in: []string{"a", "--authkey=1", "b"}, want: []string{"a", "--auth-key=1", "b"}},
{in: []string{"a", "--auth-key=2", "b"}, want: []string{"a", "--auth-key=2", "b"}},
{in: []string{"a", "-authkey=3", "b"}, want: []string{"a", "--auth-key=3", "b"}},
{in: []string{"a", "-auth-key=4", "b"}, want: []string{"a", "-auth-key=4", "b"}},
{in: []string{"a", "--authkey", "5", "b"}, want: []string{"a", "--auth-key", "5", "b"}},
{in: []string{"a", "-authkey", "6", "b"}, want: []string{"a", "--auth-key", "6", "b"}},
{in: []string{"a", "authkey", "7", "b"}, want: []string{"a", "authkey", "7", "b"}},
{in: []string{"--authkeyexpiry", "8"}, want: []string{"--authkeyexpiry", "8"}},
{in: []string{"--auth-key-expiry", "9"}, want: []string{"--auth-key-expiry", "9"}},
{in: S{"something"}, want: S{"something"}},
{in: S{}, want: S{}},
{in: S{"--authkey=0"}, want: S{"--auth-key=0"}},
{in: S{"a", "--authkey=1", "b"}, want: S{"a", "--auth-key=1", "b"}},
{in: S{"a", "--auth-key=2", "b"}, want: S{"a", "--auth-key=2", "b"}},
{in: S{"a", "-authkey=3", "b"}, want: S{"a", "--auth-key=3", "b"}},
{in: S{"a", "-auth-key=4", "b"}, want: S{"a", "-auth-key=4", "b"}},
{in: S{"a", "--authkey", "5", "b"}, want: S{"a", "--auth-key", "5", "b"}},
{in: S{"a", "-authkey", "6", "b"}, want: S{"a", "--auth-key", "6", "b"}},
{in: S{"a", "authkey", "7", "b"}, want: S{"a", "authkey", "7", "b"}},
{in: S{"--authkeyexpiry", "8"}, want: S{"--authkeyexpiry", "8"}},
{in: S{"--auth-key-expiry", "9"}, want: S{"--auth-key-expiry", "9"}},
{in: S{"--posture-checking"}, want: S{"--report-posture"}},
{in: S{"-posture-checking"}, want: S{"--report-posture"}},
{in: S{"--posture-checking=nein"}, want: S{"--report-posture=nein"}},
}
for _, tt := range tests {