You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/types/opt
Simon Law f8c9f1aca7
cmd/tailscale: get command for printing settings
For symmetry, `tailscale get` is the complement of `tailscale set`.
For every `tailscale set --SETTING`, there is now a corresponding
`tailscale get SETTING`.

While users were able to use `tailscale debug --prefs | jq .SETTING`
to extract their settings, this requires an external tool. To add
insult to injury, the names of the settings don’t always match the
keys in the JSON. For example, the `accept-dns` setting is called
`.CorpDNS`. And `advertise-exit-node` is just user-hostile.

This patch also contains tests that try to keep `getSettings` aligned
with the `setFlagSet` and `upFlagSet` flags for the `set` and `up`
commands, respectively. As a happy side-effect, this also checks that
the default values of these flags are consistent with the actual
default settings.

Closes: #2130

Signed-off-by: Simon Law <sfllaw@sfllaw.ca>
9 months ago
..
bool.go cmd/tailscale: get command for printing settings 9 months ago
bool_test.go types/opt: add BoolFlag for setting Bool value as a flag 1 year ago
value.go go.mod: bump github.com/go-json-experiment/json (#15010) 10 months ago
value_test.go all: statically enforce json/v2 interface satisfaction (#15154) 10 months ago