Skip to content

Commit d6470db

Browse files
committed
Fixup color
1 parent fd3d9b7 commit d6470db

File tree

58 files changed

+117
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+117
-96
lines changed

cli/root_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"strings"
1414
"testing"
1515

16+
"github.com/charmbracelet/lipgloss"
17+
"github.com/muesli/termenv"
1618
"github.com/stretchr/testify/assert"
1719
"github.com/stretchr/testify/require"
1820

@@ -33,8 +35,17 @@ var updateGoldenFiles = flag.Bool("update", false, "update .golden files")
3335

3436
var timestampRegex = regexp.MustCompile(`(?i)\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?Z`)
3537

38+
// We need to override the global color profile.
39+
//
40+
//nolint:tparallel,paralleltest
3641
func TestCommandHelp(t *testing.T) {
37-
t.Parallel()
42+
ogColorProfile := lipgloss.ColorProfile()
43+
// ANSI256 escape codes are far easier for humans to parse in a diff,
44+
// but TrueColor is probably more popular with modern terminals.
45+
lipgloss.SetColorProfile(termenv.ANSI)
46+
t.Cleanup(func() {
47+
lipgloss.SetColorProfile(ogColorProfile)
48+
})
3849
rootClient, replacements := prepareTestData(t)
3950

4051
type testCase struct {

cli/testdata/coder_--help.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ Usage: coder [global-flags] <subcommand>
33
Coder v0.0.0-devel — A tool for provisioning self-hosted development environments with Terraform.
44
- Start a Coder server:
55

6-
$ coder server
6+
 $ coder server 
77

88
- Get started by creating a template from an example:
99

10-
$ coder templates init
10+
 $ coder templates init 
1111

12-
Subcommands
12+
Subcommands
1313
config-ssh Add an SSH Host entry for your workspaces "ssh
1414
coder.workspace"
1515
create Create a workspace
@@ -43,7 +43,7 @@ Subcommands
4343
users Manage users
4444
version Show coder version
4545

46-
Global Options
46+
Global Options
4747
Global options are applied to all commands. They can be set using environment
4848
variables or flags.
4949

cli/testdata/coder_agent_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Usage: coder agent [flags]
22

33
Starts the Coder workspace agent.
44

5-
Options
5+
Options
66
--auth string, $CODER_AGENT_AUTH (default: token)
77
Specify the authentication type to use for the agent.
88

cli/testdata/coder_config-ssh_--help.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Add an SSH Host entry for your workspaces "ssh coder.workspace"
55
- You can use -o (or --ssh-option) so set SSH options to be used for all your
66
workspaces:
77

8-
$ coder config-ssh -o ForwardAgent=yes
8+
 $ coder config-ssh -o ForwardAgent=yes 
99

1010
- You can use --dry-run (or -n) to see the changes that would be made:
1111

12-
$ coder config-ssh --dry-run
12+
 $ coder config-ssh --dry-run 
1313

14-
Options
14+
Options
1515
-n, --dry-run bool, $CODER_SSH_DRY_RUN
1616
Perform a trial run with no changes made, showing a diff at the end.
1717

cli/testdata/coder_create_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Usage: coder create [flags] [name]
22

33
Create a workspace
44

5-
Options
5+
Options
66
--parameter-file string, $CODER_PARAMETER_FILE
77
Specify a file path with parameter values.
88

cli/testdata/coder_delete_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Delete a workspace
44

55
Aliases: rm
66

7-
Options
7+
Options
88
--orphan bool
99
Delete a workspace without deleting its resources. This can delete a
1010
workspace in a broken state, but may also lead to unaccounted cloud

cli/testdata/coder_dotfiles_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Personalize your workspace by applying a canonical dotfiles repository
44

55
- Check out and install a dotfiles repository without prompts:
66

7-
$ coder dotfiles --yes git@github.com:example/dotfiles.git
7+
 $ coder dotfiles --yes git@github.com:example/dotfiles.git 
88

9-
Options
9+
Options
1010
--symlink-dir string, $CODER_SYMLINK_DIR
1111
Specifies the directory for the dotfiles symlink destinations. If
1212
empty, will use $HOME.

cli/testdata/coder_list_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ List workspaces
44

55
Aliases: ls
66

7-
Options
7+
Options
88
-a, --all bool
99
Specifies whether all workspaces will be listed or not.
1010

cli/testdata/coder_login_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Usage: coder login [flags] <url>
22

33
Authenticate with Coder deployment
44

5-
Options
5+
Options
66
--first-user-email string, $CODER_FIRST_USER_EMAIL
77
Specifies an email address to use if creating the first user for the
88
deployment.

cli/testdata/coder_logout_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Usage: coder logout [flags]
22

33
Unauthenticate your local session
44

5-
Options
5+
Options
66
-y, --yes bool
77
Bypass prompts.
88

0 commit comments

Comments
 (0)