🧑💻 chore: Add dotfiles fish completions
This commit is contained in:
parent
239fef359d
commit
3da95d6ec2
1 changed files with 43 additions and 0 deletions
43
.config/fish/completions/dotfiles.fish
Normal file
43
.config/fish/completions/dotfiles.fish
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
set -l commands init clone ignore attributes readme
|
||||||
|
|
||||||
|
complete --command dotfiles --wraps git
|
||||||
|
|
||||||
|
# init
|
||||||
|
complete --command dotfiles \
|
||||||
|
--condition "not __fish_seen_subcommand_from $commands" \
|
||||||
|
--arguments init \
|
||||||
|
--description "Create a new bare repo with the git folder specified"
|
||||||
|
|
||||||
|
complete --command dotfiles \
|
||||||
|
--condition "__fish_seen_subcommand_from init; and not __fish_seen_subcommand_from (__fish_complete_directories)" \
|
||||||
|
--arguments "(__fish_complete_directories)"
|
||||||
|
|
||||||
|
# clone
|
||||||
|
complete --command dotfiles \
|
||||||
|
--condition "not __fish_seen_subcommand_from $commands" \
|
||||||
|
--arguments clone \
|
||||||
|
--description "Clone your dotfiles from remote and install them"
|
||||||
|
|
||||||
|
complete --command dotfiles \
|
||||||
|
--condition "__fish_seen_subcommand_from clone; and not __fish_seen_subcommand_from (__fish_complete_directories)" \
|
||||||
|
--arguments "(__fish_complete_directories)"
|
||||||
|
|
||||||
|
# ignore
|
||||||
|
complete --command dotfiles \
|
||||||
|
--condition "not __fish_seen_subcommand_from $commands" \
|
||||||
|
--arguments ignore \
|
||||||
|
--description "Add a pattern to gitignore, or edit file if none given"
|
||||||
|
|
||||||
|
# attributes
|
||||||
|
complete -f --command dotfiles \
|
||||||
|
--condition "not __fish_seen_subcommand_from $commands" \
|
||||||
|
--arguments attributes \
|
||||||
|
--description "Add a pattern to gitattributes, or edit file if none given"
|
||||||
|
|
||||||
|
# readme
|
||||||
|
complete -f --command dotfiles \
|
||||||
|
--condition "not __fish_seen_subcommand_from $commands" \
|
||||||
|
--arguments readme \
|
||||||
|
--description "Edit the README.md file"
|
Loading…
Reference in a new issue