summaryrefslogtreecommitdiff
path: root/internal/askcli/completion_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-11 22:20:57 +0300
committerPaul Buetow <paul@buetow.org>2026-04-11 22:20:57 +0300
commit69d3ec004b8de3b9f7cfeb34686b9c344c787db4 (patch)
tree857101184293efa61f9d1caba4c3b80b31e89a37 /internal/askcli/completion_test.go
parent5bc434d71fb5057131f1e5c0b2371db42d3b4ed4 (diff)
Rename task CLI binary from do back to ask
- Move cmd/do to cmd/ask; mage builds and installs ask; Fish completions to ask.fish - Update askcli help text, errors, executor default label, and Fish script (__ask_*) - Task alias cache subdirectory under XDG cache: hexai/ask/ - Rename integration test files and helpers; refresh README and docs - Rename plan-do-uuid-wrapper.md to plan-ask-uuid-wrapper.md Made-with: Cursor
Diffstat (limited to 'internal/askcli/completion_test.go')
-rw-r--r--internal/askcli/completion_test.go44
1 files changed, 22 insertions, 22 deletions
diff --git a/internal/askcli/completion_test.go b/internal/askcli/completion_test.go
index 7d85c7b..d3f08e5 100644
--- a/internal/askcli/completion_test.go
+++ b/internal/askcli/completion_test.go
@@ -18,40 +18,40 @@ func TestFishCompletion_IncludesCommandsAndExcludesExport(t *testing.T) {
}
}
for _, line := range []string{
- "# Source with: do fish | source",
- "complete -c do -n '__do_in_dep_context' -a 'add' -d 'Add a dependency'",
- "complete -c do -n '__do_in_dep_context' -a 'rm' -d 'Remove a dependency'",
- "complete -c do -n '__do_in_dep_context' -a 'list' -d 'List dependencies'",
- "function __do_command_positionals",
- "function __do_scope_prefix",
- "function __do_task_selectors",
- "function __do_add_dependency_modifiers",
- `set -l do_bin "do"`,
+ "# Source with: ask fish | source",
+ "complete -c ask -n '__ask_in_dep_context' -a 'add' -d 'Add a dependency'",
+ "complete -c ask -n '__ask_in_dep_context' -a 'rm' -d 'Remove a dependency'",
+ "complete -c ask -n '__ask_in_dep_context' -a 'list' -d 'List dependencies'",
+ "function __ask_command_positionals",
+ "function __ask_scope_prefix",
+ "function __ask_task_selectors",
+ "function __ask_add_dependency_modifiers",
+ `set -l ask_bin "ask"`,
"set -l selectors",
- "set selectors (command $do_bin complete-aliases 2>/dev/null)",
- "set selectors (command $do_bin $scope_prefix complete-aliases 2>/dev/null)",
- "case na no-agent proj:*",
+ "set selectors (command $ask_bin complete-aliases 2>/dev/null)",
+ "set selectors (command $ask_bin $scope_prefix complete-aliases 2>/dev/null)",
+ "case na no-agent 'proj:*'",
"set cache_key (string join ' ' $scope_prefix)",
- "complete -c do -n '__do_in_uuid_context' -a '(__do_task_selectors)' -d 'Task selector'",
- "complete -c do -n '__do_in_dep_uuid_context' -a '(__do_task_selectors)' -d 'Task selector'",
- "complete -c do -n '__do_in_add_dep_modifier_context' -a '(__do_add_dependency_modifiers)' -d 'Task dependency'",
+ "complete -c ask -n '__ask_in_uuid_context' -a '(__ask_task_selectors)' -d 'Task selector'",
+ "complete -c ask -n '__ask_in_dep_uuid_context' -a '(__ask_task_selectors)' -d 'Task selector'",
+ "complete -c ask -n '__ask_in_add_dep_modifier_context' -a '(__ask_add_dependency_modifiers)' -d 'Task dependency'",
// The dep modifier function must extract just the selector (before the
// tab) from each tab-separated "selector\tdescription" completion item.
- "for item in (__do_task_selectors)",
+ "for item in (__ask_task_selectors)",
"set -l selector (string split -m1 '\\t' -- $item)[1]",
} {
if !strings.Contains(script, line) {
t.Fatalf("script missing dep completion line %q", line)
}
}
- if strings.Contains(script, "do export") {
+ if strings.Contains(script, "ask export") {
t.Fatalf("script should not advertise non-existent export command")
}
- if strings.Contains(script, "assets/do.fish") {
+ if strings.Contains(script, "assets/ask.fish") {
t.Fatalf("script should not reference a static asset")
}
for _, name := range []string{"info", "annotate", "start", "stop", "done", "priority", "tag", "modify", "denotate", "delete"} {
- if strings.Contains(script, "complete -c do -n '__do_in_uuid_context' -a '"+name+"'") {
+ if strings.Contains(script, "complete -c ask -n '__ask_in_uuid_context' -a '"+name+"'") {
t.Fatalf("script should not hard-code UUID completion item %q", name)
}
}
@@ -141,10 +141,10 @@ func TestFishAddDependencyModifierCompletionContext(t *testing.T) {
}
func TestFishCompletionFor_EmbedsBinaryPath(t *testing.T) {
- script := FishCompletionFor(`/tmp/do "$HOME"`)
+ script := FishCompletionFor(`/tmp/ask "$HOME"`)
for _, line := range []string{
- `set -l do_bin "/tmp/do \"\$HOME\""`,
- "set selectors (command $do_bin complete-aliases 2>/dev/null)",
+ `set -l ask_bin "/tmp/ask \"\$HOME\""`,
+ "set selectors (command $ask_bin complete-aliases 2>/dev/null)",
} {
if !strings.Contains(script, line) {
t.Fatalf("script missing %q", line)