From cd2a8a9d097d77b92a617465d55ca59c4049f2b6 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Tue, 2 Jan 2024 15:36:45 +0100 Subject: [PATCH] Fix some error messages After testing. The invalid value is already printed by the framework, no need to include it in the error message. --- moar.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/moar.go b/moar.go index 3ac0880..20cc1ef 100644 --- a/moar.go +++ b/moar.go @@ -170,8 +170,7 @@ func parseLexerOption(lexerOption string) (chroma.Lexer, error) { } return nil, fmt.Errorf( - "Unsupported language %s, look here form inspiration: https://github.com/alecthomas/chroma/tree/master/lexers/embedded", - lexerOption, + "Look here for inspiration: https://github.com/alecthomas/chroma/tree/master/lexers/embedded", ) } @@ -220,7 +219,7 @@ func parseStatusBarStyle(styleOption string) (m.StatusBarOption, error) { return m.STATUSBAR_STYLE_BOLD, nil } - return 0, fmt.Errorf("good ones are inverse, plain and bold") + return 0, fmt.Errorf("Good ones are inverse, plain and bold") } func parseUnprintableStyle(styleOption string) (m.UnprintableStyle, error) { @@ -252,7 +251,7 @@ func parseShiftAmount(shiftAmount string) (uint, error) { } if value < 1 { - return 0, fmt.Errorf("Shift amount must be at least 1, was %d", value) + return 0, fmt.Errorf("Shift amount must be at least 1") } // Let's add an upper bound as well if / when requested