• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nagayon-935 / kuroko / 29893831830

22 Jul 2026 05:27AM UTC coverage: 83.462% (-1.3%) from 84.784%
29893831830

push

github

nagayon-935
feat: add bash shell completion for subcommands, flags, and log files

Add "kuroko completion bash" to print a completion script and a hidden
"kuroko __complete" helper that computes candidates for the subcommand
position (logs/view/help/completion plus PATH commands), the view log
filename argument (honoring -d/--log-dir overrides), and global flags.
Extract the shared .log/.log.gz enumeration into internal/logstore so the
selector TUI and completion draw from one source.

68 of 94 new or added lines in 5 files covered. (72.34%)

81 existing lines in 1 file now uncovered.

1948 of 2334 relevant lines covered (83.46%)

90.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/internal/completion/script.go
1
package completion
2

3
import (
4
        _ "embed"
5
        "fmt"
6
        "io"
7
)
8

9
//go:embed scripts/kuroko.bash
10
var bashScript string
11

12
// WriteScript writes the shell-completion script for shell to w. An empty
13
// shell defaults to bash. Only bash is currently supported; zsh and fish
14
// are recognized subcommand values (see Candidates) but not yet implemented.
15
func WriteScript(w io.Writer, shell string) error {
4✔
16
        if shell == "" {
5✔
17
                shell = "bash"
1✔
18
        }
1✔
19
        switch shell {
4✔
20
        case "bash":
2✔
21
                _, err := io.WriteString(w, bashScript)
2✔
22
                return err
2✔
23
        case "zsh", "fish":
2✔
24
                return fmt.Errorf("completion: %s is not yet supported", shell)
2✔
NEW
25
        default:
×
NEW
26
                return fmt.Errorf("completion: unknown shell %q", shell)
×
27
        }
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc