numerous changes
+ fish & bash completions + -w/--where option M moved util_readf to _reve.sh M linter-detected warnings fixed M less variable clutter
This commit is contained in:
34
completions/reve.bash
Normal file
34
completions/reve.bash
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
_reve_completions() {
|
||||
local cur prev opts modes reasons chores
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="-h --help -m --mode -r --reason -c --chore -w --where --shell-completion"
|
||||
modes="dark light"
|
||||
reasons="time network"
|
||||
chores=$(ls ~/.config/reve/chores/mode | sed 's/\.sh$//')
|
||||
|
||||
case "${prev}" in
|
||||
-m|--mode)
|
||||
COMPREPLY=( $(compgen -W "${modes}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
-r|--reason)
|
||||
COMPREPLY=( $(compgen -W "${reasons}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
-c|--chore)
|
||||
COMPREPLY=( $(compgen -W "${chores}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _reve_completions reve
|
||||
24
completions/reve.fish
Normal file
24
completions/reve.fish
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# reve desktop environment framework
|
||||
# Yigid BALABAN <fyb@fybx.dev> 2024
|
||||
|
||||
function __reve_complete_modes
|
||||
echo "dark"
|
||||
echo "light"
|
||||
end
|
||||
|
||||
function __reve_complete_reasons
|
||||
echo "time"
|
||||
echo "network"
|
||||
end
|
||||
|
||||
function __reve_complete_chores
|
||||
ls ~/.config/reve/chores/mode | sed 's/\.sh$//'
|
||||
end
|
||||
|
||||
complete -c reve -s m -l mode -a '(__reve_complete_modes)' -d 'Specify desktop mode (dark or light)'
|
||||
complete -c reve -s r -l reason -a '(__reve_complete_reasons)' -d 'Specify the reason (time or network)'
|
||||
complete -c reve -s c -l chore -a '(__reve_complete_chores)' -d 'Specify a chore to run'
|
||||
complete -c reve -s w -l where -d 'Display the installation path of reve'
|
||||
complete -c reve -s h -l help -d 'Show help message'
|
||||
Reference in New Issue
Block a user