mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 22:14:53 +00:00
feat(completion): move function to functions/*
This commit is contained in:
parent
d7869fa42d
commit
39b5759bb0
4 changed files with 26 additions and 28 deletions
|
@ -1,15 +1,3 @@
|
||||||
function __fish_termux_api__complete_camera_ids
|
|
||||||
set -l command termux-camera-info
|
|
||||||
set ids ($command | jq --raw-output '.[].id')
|
|
||||||
set types ($command | jq --raw-output '.[].facing')
|
|
||||||
|
|
||||||
printf "0\tdefault\n"
|
|
||||||
|
|
||||||
for index in (seq (count $ids))
|
|
||||||
printf "%s\t%s\n" $ids[$index] $types[$index]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
set command termux-camera-photo
|
set command termux-camera-photo
|
||||||
|
|
||||||
complete -c $command -f
|
complete -c $command -f
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
function __fish_termux_api__complete_group_ids
|
|
||||||
set -l command termux-notification-list
|
|
||||||
set ids ($command | jq --raw-output '.[].group')
|
|
||||||
set titles ($command | jq --raw-output '.[].title')
|
|
||||||
|
|
||||||
for index in (seq (count $ids))
|
|
||||||
set -l id $ids[$index]
|
|
||||||
set -l title $titles[$index]
|
|
||||||
|
|
||||||
test -z "$id" && continue
|
|
||||||
test -z "$title" && set title "Unknown title"
|
|
||||||
|
|
||||||
printf "%s\t%s\n" $id $title
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
set command termux-notification
|
set command termux-notification
|
||||||
|
|
||||||
complete -c $command -f
|
complete -c $command -f
|
||||||
|
|
11
share/functions/__fish_termux_api__complete_camera_ids.fish
Normal file
11
share/functions/__fish_termux_api__complete_camera_ids.fish
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
function __fish_termux_api__complete_camera_ids
|
||||||
|
set -l command termux-camera-info
|
||||||
|
set ids ($command | jq --raw-output '.[].id')
|
||||||
|
set types ($command | jq --raw-output '.[].facing')
|
||||||
|
|
||||||
|
printf "0\tdefault\n"
|
||||||
|
|
||||||
|
for index in (seq (count $ids))
|
||||||
|
printf "%s\t%s\n" $ids[$index] $types[$index]
|
||||||
|
end
|
||||||
|
end
|
15
share/functions/__fish_termux_api__complete_group_ids.fish
Normal file
15
share/functions/__fish_termux_api__complete_group_ids.fish
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
function __fish_termux_api__complete_group_ids
|
||||||
|
set -l command termux-notification-list
|
||||||
|
set ids ($command | jq --raw-output '.[].group')
|
||||||
|
set titles ($command | jq --raw-output '.[].title')
|
||||||
|
|
||||||
|
for index in (seq (count $ids))
|
||||||
|
set -l id $ids[$index]
|
||||||
|
set -l title $titles[$index]
|
||||||
|
|
||||||
|
test -z "$id" && continue
|
||||||
|
test -z "$title" && set title "Unknown title"
|
||||||
|
|
||||||
|
printf "%s\t%s\n" $id $title
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue