96 lines
5.1 KiB
Plaintext
96 lines
5.1 KiB
Plaintext
#compdef stack
|
|
# ------------------------------------------------------------------------------
|
|
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are met:
|
|
# * Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
# documentation and/or other materials provided with the distribution.
|
|
# * Neither the name of the zsh-users nor the
|
|
# names of its contributors may be used to endorse or promote products
|
|
# derived from this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
|
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
# ------------------------------------------------------------------------------
|
|
# Description
|
|
# -----------
|
|
#
|
|
# Completion script for stack (https://github.com/commercialhaskell/stack).
|
|
#
|
|
# ------------------------------------------------------------------------------
|
|
# Authors
|
|
# -------
|
|
#
|
|
# * Toshiki Teramura <toshiki.teramura@gmail.com>
|
|
#
|
|
# ------------------------------------------------------------------------------
|
|
|
|
_stack () {
|
|
_arguments \
|
|
--version'[display version information]' \
|
|
--help'[display usage information]' \
|
|
'--docker*''[run "stack --docker-help" for details]' \
|
|
--verbosity'[verbosity: silent, error, warn, info, debug]' \
|
|
{-v,--verbose}'[enable verbose mode: verbosity level "debug"]' \
|
|
--system-ghc'[enable using the system installed GHC (on the PATH) if available and a matching version]' \
|
|
--no-system-ghc'[disable using the system installed GHC (on the PATH) if available and a matching version]' \
|
|
--install-ghc'[enable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
|
|
--no-install-ghc'[disable downloading and installing GHC if necessary (can be done manually with stack setup)]' \
|
|
--arch'[system architecture, e.g. i386, x86_64]' \
|
|
--os'[operating system, e.g. linux, windows]' \
|
|
{-j,--jobs}'[number of concurrent jobs to run]' \
|
|
--extra-include-dirs'[extra directories to check for C header files]' \
|
|
--extra-lib-dirs'[extra directories to check for libraries]' \
|
|
--skip-ghc-check'[enable skipping the GHC version and architecture check]' \
|
|
--no-skip-ghc-check'[disable skipping the GHC version and architecture check]' \
|
|
--skip-msys'[enable skipping the local MSYS installation (Windows only)]' \
|
|
--no-skip-msys'[disable skipping the local MSYS installation (Windows only)]' \
|
|
--resolver'[override resolver in project file]' \
|
|
--no-terminal'[override terminal detection in the case of running in a false terminal]' \
|
|
--stack-yaml'[override project stack.yaml file (overrides any STACK_YAML environment variable)]' \
|
|
'*: :__stack_modes'
|
|
}
|
|
|
|
__stack_modes () {
|
|
_values \
|
|
'subcommand' \
|
|
'build[build the project(s) in this directory/configuration]' \
|
|
'install[build executables and install to a user path]' \
|
|
'test[build and test the project(s) in this directory/configuration]' \
|
|
'bench[build and benchmark the project(s) in this directory/configuration]' \
|
|
'haddock[generate haddocks for the project(s) in this directory/configuration]' \
|
|
'new[create a brand new project]' \
|
|
'init[initialize a stack project based on one or more cabal packages]' \
|
|
'solver[use a dependency solver to try and determine missing extra-deps]' \
|
|
'setup[get the appropriate ghc for your project]' \
|
|
'path[print out handy path information]' \
|
|
'unpack[unpack one or more packages locally]' \
|
|
'update[update the package index]' \
|
|
'upgrade[upgrade to the latest stack (experimental)]' \
|
|
'upload[upload a package to Hackage]' \
|
|
'dot[visualize your projects dependency graph using Graphviz dot]' \
|
|
'exec[execute a command]' \
|
|
'ghc[run ghc]' \
|
|
'ghci[run ghci in the context of project(s)]' \
|
|
'ide[run ide-backend-client with the correct arguments]' \
|
|
'runghc[run runghc]' \
|
|
'clean[clean the local packages]' \
|
|
'docker[subcommands specific to Docker use]'
|
|
|
|
}
|
|
|
|
_stack "$@"
|