Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var applyCmd = &cobra.Command{
}

if len(toApply) == 0 {
fmt.Print("No changes. System matches spec.\n")
fmt.Print("No changes. macOS configuration is up-to-date.\n")
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions examples/macform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ keyboard:
# Default: true
press-and-hold: true

# Description: Automatically replace double hyphens and other dash sequences with em/en dashes
# Type: bool
# Default: true
smart-dashes: true

hot-corners:
# Description: Action triggered when the cursor reaches the top-left corner of the screen
# Type: string
Expand Down
14 changes: 8 additions & 6 deletions internal/output/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
)

const (
colorCyan = "\033[1;96m"
colorGreen = "\033[32m"
colorYellow = "\033[33m"
colorRed = "\033[31m"
colorReset = "\033[0m"
colorCyan = "\033[1;96m"
colorGreen = "\033[32m"
colorBoldGreen = "\033[1;32m"
colorYellow = "\033[33m"
colorRed = "\033[31m"
colorReset = "\033[0m"
)

// Printer writes plan output to Out, optionally with ANSI color.
Expand All @@ -36,7 +37,8 @@ func (p *Printer) PrintPlan(entries []diff.DiffEntry) {
}

if len(changed) == 0 {
fmt.Fprintln(p.Out, "No changes. System matches spec.")
p.colored(colorBoldGreen, "No changes.")
fmt.Fprintln(p.Out, " macOS configuration is up-to-date.")
return
}

Expand Down
4 changes: 2 additions & 2 deletions internal/output/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestPrintPlan_NoChanges(t *testing.T) {
p.PrintPlan(entries)

got := buf.String()
want := "No changes. System matches spec.\n"
want := "No changes. macOS configuration is up-to-date.\n"
if got != want {
t.Errorf("expected %q, got %q", want, got)
}
Expand All @@ -37,7 +37,7 @@ func TestPrintPlan_NoChanges_EmptyEntries(t *testing.T) {
p.PrintPlan(nil)

got := buf.String()
want := "No changes. System matches spec.\n"
want := "No changes. macOS configuration is up-to-date.\n"
if got != want {
t.Errorf("expected %q, got %q", want, got)
}
Expand Down
5 changes: 5 additions & 0 deletions internal/registry/keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ var keyboardSettings = []SettingDef{
Type: "bool",
Provider: provider.NewDefaults("NSGlobalDomain", "ApplePressAndHoldEnabled", "bool"),
},
{
SpecKey: "smart-dashes",
Type: "bool",
Provider: provider.NewDefaults("NSGlobalDomain", "NSAutomaticDashSubstitutionEnabled", "bool"),
},
}