Skip to content

Commit

Permalink
Add mage completions for working with magefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ViViDboarder committed Aug 16, 2023
1 parent f0c5125 commit 67617a1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions assets/default/fish/completions/mage.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# completions for mage build system for golang

function __mage_list_targets --description 'list all mage targets'
mage -l | awk '/^ / { gsub(/\*/, "", $1); print $1; }'
end

complete --command mage --old-option h --no-files --description 'show help'
complete --command mage --old-option clean --no-files --description 'clean out generated binaries'
complete --command mage --old-option init --no-files --description 'create a starting template if no magefile exists'
complete --command mage --old-option l --no-files --description 'list mage targets'
complete --command mage --old-option version --no-files --description 'show version'
complete --command mage --old-option d --description 'dir to read magefiles from'
complete --command mage --old-option f --no-files --description 'force recreation of compiled magefile'
complete --command mage --old-option goarch --no-files --description 'set GOARCH for binary created by -compile'
complete --command mage --old-option gocmd --no-files --description 'use given go binary for compilation'
complete --command mage --old-option goos --no-files --description 'set GOOS for binary created by -compile'
complete --command mage --old-option keep --no-files --description 'keep intermediate magefiles after running'
complete --command mage --old-option t --no-files --description 'timeout duration'
complete --command mage --old-option v --no-files --description 'verbose logging'
complete --command mage --old-option w --description 'working dir'
complete --command mage --old-option compile --description 'compile binary to path'
complete --command mage --no-files -a '(__mage_list_targets)' --description 'Target'

0 comments on commit 67617a1

Please sign in to comment.