Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/packaging/specs-completion.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#compdef specs

_specs() {
local cur prev
local -a completions

cur="${words[CURRENT]}"
prev="${words[CURRENT-1]}"

# Call specs-autocomplete and capture newline-separated results
completions=("${(@f)$(specs-autocomplete specs "$cur" "$prev")}")

compadd -- $completions
}

_specs "$@"

2 changes: 2 additions & 0 deletions specs/src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ def python_search(arg):

install_mac: $(EXE_DIR)/specs specs.1.gz
cp $(EXE_DIR)/specs /usr/local/bin/
cp $(EXE_DIR)/specs-autocomplete /usr/local/bin/
/bin/rm */*.d
$(MKDIR_C) /usr/local/share/man/man1
cp specs.1.gz /usr/local/share/man/man1/
/bin/rm specs.1.gz
cp ../../.github/packaging/specs-completion.zsh /usr/local/share/zsh/site-functions/_specs

install_linux: $(EXE_DIR)/specs specs.1.gz
cp $(EXE_DIR)/specs /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion specs/src/test/specs-autocomplete.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ int main(int argc, char** argv)
try { cursorPos = std::stoul(safe); } catch (const std::exception&) {}
}
safe = getenv("COMP_TYPE");
char type = '\t';
char type = '?';
if (safe) {
try { type = char(std::stoi(safe)); } catch (const std::exception&) {}
}
Expand Down
Loading