diff --git a/cmd/apply.go b/cmd/apply.go index e06dccf..acb4d00 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -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 } diff --git a/examples/macform.yaml b/examples/macform.yaml index cc27ec3..4b54823 100644 --- a/examples/macform.yaml +++ b/examples/macform.yaml @@ -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 diff --git a/internal/output/printer.go b/internal/output/printer.go index 393364c..800d72f 100644 --- a/internal/output/printer.go +++ b/internal/output/printer.go @@ -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. @@ -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 } diff --git a/internal/output/printer_test.go b/internal/output/printer_test.go index 6586e3c..7880124 100644 --- a/internal/output/printer_test.go +++ b/internal/output/printer_test.go @@ -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) } @@ -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) } diff --git a/internal/registry/keyboard.go b/internal/registry/keyboard.go index 108eaf9..84be94a 100644 --- a/internal/registry/keyboard.go +++ b/internal/registry/keyboard.go @@ -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"), + }, }