commit e9c985881595a6bfc0534870c9c3d54fd88b4ef1
parent fee08de124dc0715238be62cb426f8cffc226de4
Author: Sean Enck <sean@ttypty.com>
Date: Sun, 15 Jun 2025 08:24:40 -0400
cleanup some help changes
Diffstat:
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/internal/app/commands/core.go b/internal/app/commands/core.go
@@ -76,6 +76,7 @@ var (
KeyFile string
NoKey string
}{"keyfile", "nokey"}
+ // ReadOnly are readonly commands (they don't work in readonly mode)
ReadOnly = []string{Insert, Move, ReKey, Remove, Unset}
)
diff --git a/internal/app/help/core.go b/internal/app/help/core.go
@@ -6,6 +6,7 @@ import (
"embed"
"fmt"
"path/filepath"
+ "slices"
"sort"
"strings"
"text/template"
@@ -117,7 +118,7 @@ func Usage(verbose bool, exe string) ([]string, error) {
HelpCommand: commands.Help,
HelpConfigCommand: commands.HelpConfig,
NoColor: config.NoColorFlag,
- ReadOnlyCommands: strings.Join(commands.ReadOnly, ", "),
+ ReadOnlyCommands: strings.Join(commands.ReadOnly, ", "),
}
document.Config.Env = config.ConfigEnv
document.Config.Home = config.ConfigHome
@@ -148,15 +149,12 @@ func Usage(verbose bool, exe string) ([]string, error) {
}
adding := ""
section := strings.TrimSuffix(filepath.Base(n), textFile)
- for _, key := range []string{
+ if slices.Contains([]string{
"totp",
"color",
"clipboard",
- } {
- if section == key {
- adding = "This functionality can be controlled by a configuration feature flag."
- break
- }
+ }, section) {
+ adding = "This functionality can be controlled by a configuration feature flag."
}
header := fmt.Sprintf("[%s]", section)
s, err := processDoc(header, n, document)