commit 1ae358783385aca712e96daad12d76953f83af4e
parent 8180ca59ae7f451223601dff2b65d4446e75739f
Author: Sean Enck <sean@ttypty.com>
Date: Sat, 14 Jun 2025 11:37:26 -0400
include boilerplate config text for features
Diffstat:
5 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/internal/app/help/core.go b/internal/app/help/core.go
@@ -154,20 +154,23 @@ func Usage(verbose bool, exe string) ([]string, error) {
continue
}
section := strings.TrimSuffix(filepath.Base(n), textFile)
- switch section {
- case "totp":
- if !canTOTP {
- continue
+ skip := false
+ adding := ""
+ for k, v := range map[string]bool{
+ "totp": canTOTP,
+ "color": canColor,
+ "clipboard": canClip,
+ } {
+ if section == k {
+ if !v {
+ skip = true
+ }
+ adding = "This functionality can be controlled by a configuration feature flag."
+ break
}
- case "clipboard":
- if !canClip {
- continue
- }
- case "color":
- if !canColor {
- continue
- }
-
+ }
+ if skip {
+ continue
}
header := fmt.Sprintf("[%s]", section)
s, err := processDoc(header, n, document)
@@ -175,6 +178,9 @@ func Usage(verbose bool, exe string) ([]string, error) {
return nil, err
}
buf.WriteString(s)
+ if adding != "" {
+ buf.WriteString(fmt.Sprintf("%s\n\n", adding))
+ }
}
results = append(results, strings.Split(strings.TrimSpace(buf.String()), "\n")...)
}
diff --git a/internal/app/help/core_test.go b/internal/app/help/core_test.go
@@ -15,7 +15,7 @@ func TestUsage(t *testing.T) {
t.Errorf("invalid usage, out of date? %d", len(u))
}
u, _ = help.Usage(true, "lb")
- if len(u) != 117 {
+ if len(u) != 121 {
t.Errorf("invalid verbose usage, out of date? %d", len(u))
}
for _, usage := range u {
diff --git a/internal/app/help/doc/clipboard.txt b/internal/app/help/doc/clipboard.txt
@@ -1,4 +1,3 @@
By default clipboard commands are detected via determing the platform and
utilizing default commands to interact with (copy to/paste to) the clipboard.
-These settings can be overriden via configuration. This feature can be
-controlled by a configuration feature flag.
+These settings can be overriden via configuration.
diff --git a/internal/app/help/doc/color.txt b/internal/app/help/doc/color.txt
@@ -1 +1,2 @@
-Color can be controlled via a feature flag and also respects {{ $.NoColor }}
+Certain components of '{{ $.Executable }}' will output in color.
+This feature respects {{ $.NoColor }}
diff --git a/internal/app/help/doc/totp.txt b/internal/app/help/doc/totp.txt
@@ -1,3 +1,3 @@
By default '{{ $.Executable }}' tries to use some reasonable defaults to setup/manage oauth
token inputs and displaying of code outputs. Many of these settings can be
-changed via configuration. This feature can be controlled by a configuration feature flag.
+changed via configuration.