Merge pull request #499 from tejanium/master

Update completion for mix
This commit is contained in:
nicoulaj 2017-05-12 20:02:39 +02:00 committed by GitHub
commit de1508d194
1 changed files with 142 additions and 50 deletions

192
src/_mix
View File

@ -32,74 +32,89 @@
# #
# Completion script for Elixir Mix # Completion script for Elixir Mix
# #
# Last updated: 23.01.2016 # Last updated: 18.04.2017
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
# ------- # -------
# #
# * Han Ngo (https://github.com/tieubao) # * Han Ngo (https://github.com/tieubao)
# * Teja Sophista (https://github.com/tejanium)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local -a _1st_arguments local -a _1st_arguments
_1st_arguments=( _1st_arguments=(
'app.start:Start all registered apps' 'app.start:Starts all registered apps'
'archive:List all archives' 'app.tree:Prints the application tree'
'archive.build:Archive this project into a .ez file' 'archive:Lists installed archives'
'archive.install:Install an archive locally' 'archive.build:Archives this project into a .ez file'
'archive.uninstall:Uninstall archives' 'archive.install:Installs an archive locally'
'clean:Delete generated application files' 'archive.uninstall:Uninstalls archives'
'clean:Deletes generated application files'
'cmd:Executes the given command' 'cmd:Executes the given command'
'compile:Compile source files' 'compile:Compiles source files'
'compile.protocols:Consolidates all protocols in all paths' 'deps:Lists dependencies and their status'
'deps:List dependencies and their status' "deps.clean:Deletes the given dependencies' files"
"deps.clean:Remove the given dependencies' files" 'deps.compile:Compiles dependencies'
'deps.compile:Compile dependencies' 'deps.get:Gets all out of date dependencies'
'deps.get:Get all out of date dependencies' 'deps.tree:Prints the dependency tree'
'deps.unlock:Unlock the given dependencies' 'deps.unlock:Unlocks the given dependencies'
'deps.update:Update the given dependencies' 'deps.update:Updates the given dependencies'
'do:Executes the tasks separated by comma' 'do:Executes the tasks separated by comma'
'ecto.create:Create the storage for the repo' 'ecto:Prints Ecto help information'
'ecto.drop:Drop the storage for the repo' 'ecto.create:Creates the repository storage'
'ecto.gen.migration:Generate a new migration for the repo' 'ecto.drop:Drops the repository storage'
'ecto.gen.repo:Generate a new repository' 'ecto.dump:Dumps the repository database structure'
'ecto.migrate:Run migrations up on a repo' 'ecto.gen.migration:Generates a new migration for the repo'
'ecto.rollback:Rollback migrations from a repo' 'ecto.gen.repo:Generates a new repository'
'ecto.load:Loads previously dumped database structure'
'ecto.migrate:Runs the repository migrations'
'ecto.migrations:Displays the repository migration status'
'ecto.rollback:Rolls back the repository migrations'
'escript:Lists installed escripts'
'escript.build:Builds an escript for the project' 'escript.build:Builds an escript for the project'
'gettext.extract:Get text extract' 'escript.install:Installs an escript locally'
'gettext.merge:Get text merge' 'escript.uninstall:Uninstalls escripts'
'help:Print help information for tasks' 'gettext.extract:Extracts translations from source code'
'hex:Print hex help information' 'gettext.merge:Merge template files into translation files'
'help:Prints help information for tasks'
'hex:Prints Hex help information'
'hex.build:Builds a new package version locally' 'hex.build:Builds a new package version locally'
'hex.config:Read or update hex config' 'hex.config:Reads, updates or deletes Hex config'
'hex.docs:Publish docs for package' 'hex.docs:Fetch or open documentation of a package'
'hex.info:Print hex information' 'hex.info:Prints Hex information'
'hex.key:Hex API key tasks' 'hex.key:Manages Hex API key'
'hex.outdated:Shows outdated hex deps for the current project' 'hex.outdated:Shows outdated Hex deps for the current project'
'hex.owner:Hex package ownership tasks' 'hex.owner:Manages Hex package ownership'
'hex.publish:Publish a new package version' 'hex.public_keys:Manages Hex public keys'
'hex.registry:Hex registry tasks' 'hex.publish:Publishes a new package version'
'hex.search:Search for package names' 'hex.retire:Retires a package version'
'hex.user:Hex user tasks' 'hex.search:Searches for package names'
'hex.user:Registers or manages Hex user'
'loadconfig:Loads and persists the given configuration' 'loadconfig:Loads and persists the given configuration'
'local:List local tasks' 'local:Lists local tasks'
'local.hex:Install hex locally' 'local.hex:Installs Hex locally'
'local.public_keys:Public keys' 'local.public_keys:Manages public keys'
'local.rebar:Install rebar locally' 'local.rebar:Installs Rebar locally'
'new:Create a new Elixir project' 'new:Creates a new Elixir project'
'phoenix.digest:Digests and compress static files'
'phoenix.gen.channel:Generates a Phoenix channel'
'phoenix.gen.html:Generates controller, model and views for an HTML based resource' 'phoenix.gen.html:Generates controller, model and views for an HTML based resource'
'phoenix.gen.json:Generates a controller and model for a JSON based resource'
'phoenix.gen.model:Generates an Ecto model'
'phoenix.gen.secret:Generates a secret'
'phoenix.new:Create a new Phoenix application'
'phoenix.routes:Prints all routes'
'phoenix.server:Starts applications and their servers' 'phoenix.server:Starts applications and their servers'
'phx.digest:Digests and compresses static files'
'phx.digest.clean:Removes old versions of static assets.'
'phx.gen.channel:Generates a Phoenix channel'
'phx.gen.context:Generates a context with functions around an Ecto schema'
'phx.gen.html:Generates controller, views, and context for an HTML resource'
'phx.gen.json:Generates controller, views, and context for a JSON resource'
'phx.gen.presence:Generates a Presence tracker'
'phx.gen.schema:Generates an Ecto schema and migration file'
'phx.gen.secret:Generates a secret'
'phx.routes:Prints all routes'
'phx.server:Starts applications and their servers'
'profile.fprof:Profiles the given file or expression with fprof' 'profile.fprof:Profiles the given file or expression with fprof'
'run:Run the given file or expression' 'run:Runs the given file or expression'
"test:Run a project's tests" "test:Runs a project's tests"
'xref:Performs cross reference checks'
'--help:Describe available tasks' '--help:Describe available tasks'
'--version:Prints the Elixir version information' '--version:Prints the Elixir version information'
) )
@ -109,7 +124,78 @@ __task_list ()
local expl local expl
declare -a tasks declare -a tasks
tasks=$(mix --help | grep -v "default task" | awk '{print $2}') tasks=(
'app.start'
'app.tree'
'archive'
'archive.build'
'archive.install'
'archive.uninstall'
'clean'
'cmd'
'compile'
'deps'
'deps.clean'
'deps.compile'
'deps.get'
'deps.tree'
'deps.unlock'
'deps.update'
'do'
'ecto'
'ecto.create'
'ecto.drop'
'ecto.dump'
'ecto.gen.migration'
'ecto.gen.repo'
'ecto.load'
'ecto.migrate'
'ecto.migrations'
'ecto.rollback'
'escript'
'escript.build'
'escript.install'
'escript.uninstall'
'gettext.extract'
'gettext.merge'
'help'
'hex'
'hex.build'
'hex.config'
'hex.docs'
'hex.info'
'hex.key'
'hex.outdated'
'hex.owner'
'hex.public_keys'
'hex.publish'
'hex.retire'
'hex.search'
'hex.user'
'loadconfig'
'local'
'local.hex'
'local.public_keys'
'local.rebar'
'new'
'phoenix.gen.html'
'phoenix.server'
'phx.digest'
'phx.digest.clean'
'phx.gen.channel'
'phx.gen.context'
'phx.gen.html'
'phx.gen.json'
'phx.gen.presence'
'phx.gen.schema'
'phx.gen.secret'
'phx.routes'
'phx.server'
'profile.fprof'
'run'
'test'
'xref'
)
_wanted tasks expl 'help' compadd $tasks _wanted tasks expl 'help' compadd $tasks
} }
@ -133,6 +219,12 @@ case $state in
case $line[1] in case $line[1] in
(help) (help)
_arguments ':feature:__task_list' _arguments ':feature:__task_list'
return
;;
(test)
_arguments ':PATH:_files'
return
;;
esac esac
;; ;;
esac esac