feat: Rename config-ssh --diff to --dry-run (#2575)

* feat: Rename config-ssh `--diff` to `--dry-run`

Since the intent between diff and dry-run are different, this change
allows for interactive prompts to be shown during `--dry-run`,
previously prompts were disabled. Dry-run can also be chanied with
`--yes` and `--use-previous-options` for non-interactive modes.

Dry-run is like a normal run with changes replaced by diff.

Fixes #2530

Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Mathias Fredriksson
2022-06-22 18:33:08 +03:00
committed by GitHub
co-authored by Cian Johnston
parent bd19fcbae1
commit 11c47e0d3b
2 changed files with 53 additions and 57 deletions
+20
View File
@@ -494,6 +494,26 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
"--yes",
},
},
{
name: "Do not overwrite config when using --dry-run",
writeConfig: writeConfig{
ssh: strings.Join([]string{
baseHeader,
"",
}, "\n"),
},
wantConfig: wantConfig{
ssh: strings.Join([]string{
baseHeader,
"",
}, "\n"),
},
args: []string{
"--ssh-option", "ForwardAgent=yes",
"--dry-run",
"--yes",
},
},
// Tests for deprecated split coder config.
{