Skip to content

Commit

Permalink
Merge pull request #18 from nonnymoose/master
Browse files Browse the repository at this point in the history
Add support for completions in the fish shell
  • Loading branch information
metti committed Dec 31, 2018
2 parents 3dce877 + d034600 commit 2ee1cd4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ INSTALL (FILES cnf.sh
WORLD_READ
DESTINATION etc/profile.d)

INSTALL (FILES cnf.fish
PERMISSIONS OWNER_WRITE
OWNER_READ
GROUP_READ
WORLD_READ
RENAME __fish_command_not_found_handler.fish
DESTINATION usr/share/fish/vendor_functions.d)

INSTALL (FILES ${PROJECT_BINARY_DIR}/${BINARY_NAME}-sync
PERMISSIONS OWNER_WRITE
OWNER_EXECUTE
Expand Down
12 changes: 12 additions & 0 deletions src/cnf.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function __fish_command_not_found_handler --on-event fish_command_not_found
if test -x "/usr/bin/cnf-lookup"
cnf-lookup -c -- $argv[1]
if test $status -ne 0
__fish_default_command_not_found_handler $argv[1]
end
else
__fish_default_command_not_found_handler $argv[1]
end
# no need to return an error code for fish
end

0 comments on commit 2ee1cd4

Please sign in to comment.