2013-06-11 20:12:45 +00:00
# Completion for bundler
2017-10-11 17:17:35 +00:00
function __fish_bundle_no_command -d 'Test if bundle has been given no subcommand'
2024-01-22 06:42:45 +00:00
set -l cmd ( commandline -xpc )
2021-11-23 13:45:28 +00:00
if test ( count $cmd ) -eq 1
2019-05-05 10:53:09 +00:00
return 0
end
return 1
2013-06-11 20:12:45 +00:00
end
2017-10-11 17:17:35 +00:00
function __fish_bundle_using_command -d 'Test if bundle has been given a specific subcommand'
2024-01-22 06:42:45 +00:00
set -l cmd ( commandline -xpc )
2021-11-23 13:45:28 +00:00
if test ( count $cmd ) -gt 1
if test $argv [ 1 ] = $cmd [ 2 ]
2019-05-05 10:53:09 +00:00
return 0
end
2013-06-11 20:12:45 +00:00
end
2019-05-05 10:53:09 +00:00
return 1
2013-06-11 20:12:45 +00:00
end
function __fish_bundled_gems
2019-05-05 10:53:09 +00:00
bundle list | sed '1 d' | sed -e 's/\*//g' -e 's/(.*)//g' -e 's/^ *//g' -e 's/ *$//g'
2013-06-11 20:12:45 +00:00
end
# Options for all commands
2017-10-11 17:17:35 +00:00
complete -c bundle -s r -l retry -d 'Specify the number of times you wish to attempt network commands'
complete -c bundle -l no-color -d 'Disable colorization in output'
complete -c bundle -s V -l verbose -d 'Enable verbose output mode'
2013-06-11 20:12:45 +00:00
# No command
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -l help -d 'Display a help page'
2017-10-11 17:17:35 +00:00
complete -c bundle -s v -l version -d 'Prints version information'
2013-06-11 20:12:45 +00:00
##
# Primary Commands
##
# Install
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a install -d 'Install the gems specified by the Gemfile or Gemfile.lock'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command install' -c bundle -l gemfile -d 'The location of the Gemfile bundler should use'
complete -f -n '__fish_bundle_using_command install' -c bundle -l path -d 'The location to install the gems in the bundle to'
complete -f -n '__fish_bundle_using_command install' -c bundle -l system -d 'Installs the gems in the bundle to the system location'
complete -f -n '__fish_bundle_using_command install' -c bundle -l without -d 'A space-separated list of groups to skip installing'
complete -f -n '__fish_bundle_using_command install' -c bundle -l local -d 'Use cached gems instead of connecting to rubygems.org'
complete -f -n '__fish_bundle_using_command install' -c bundle -l deployment -d "Switches bundler's defaults into deployment mode."
complete -f -n '__fish_bundle_using_command install' -c bundle -l binstubs -d 'Create a directory containing executabes that run in the context of the bundle'
complete -f -n '__fish_bundle_using_command install' -c bundle -l shebang -d 'Specify a ruby executable to use with generated binstubs'
complete -f -n '__fish_bundle_using_command install' -c bundle -l standalone -d 'Make a bundle that can work without RubyGems or Bundler at run-time'
complete -f -n '__fish_bundle_using_command install' -c bundle -s P -l trust-policy -d 'Apply a RubyGems security policy: {High,Medium,Low,No}Security'
2019-11-25 11:03:25 +00:00
complete -f -n '__fish_bundle_using_command install' -c bundle -s j -l jobs -d 'Install gems parallelly by starting size number of parallel workers'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command install' -c bundle -l no-cache -d 'Do not update the cache in vendor/cache with the newly bundled gems'
complete -f -n '__fish_bundle_using_command install' -c bundle -l quiet -d 'Do not print progress information to stdout'
complete -f -n '__fish_bundle_using_command install' -c bundle -l clean -d 'Run bundle clean automatically after install'
complete -f -n '__fish_bundle_using_command install' -c bundle -l full-index -d 'Use the rubygems modern index instead of the API endpoint'
complete -f -n '__fish_bundle_using_command install' -c bundle -l no-prune -d 'Do not remove stale gems from the cache'
complete -f -n '__fish_bundle_using_command install' -c bundle -l frozen -d 'Do not allow the Gemfile.lock to be updated after this install'
2013-06-11 20:12:45 +00:00
# Update
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a update -d 'Update dependencies to their latest versions'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command update' -c bundle -l source -d 'The name of a :git or :path source used in the Gemfile'
complete -f -n '__fish_bundle_using_command update' -c bundle -l local -d 'Do not attempt to fetch gems remotely and use the gem cache instead'
complete -f -n '__fish_bundle_using_command update' -c bundle -l quiet -d 'Only output warnings and errors'
complete -f -n '__fish_bundle_using_command update' -c bundle -l full-index -d 'Use the rubygems modern index instead of the API endpoint'
complete -f -n '__fish_bundle_using_command update' -c bundle -s j -l jobs -d 'Specify the number of jobs to run in parallel'
complete -f -n '__fish_bundle_using_command update' -c bundle -s g -l group -d 'Update a specific group'
2013-06-11 20:12:45 +00:00
complete -f -n '__fish_bundle_using_command update' -c bundle -a '(__fish_bundled_gems)'
# Package
2021-05-28 16:50:01 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a package -d 'Package the .gem files into vendor/cache directory'
2013-06-11 20:12:45 +00:00
2014-10-26 17:18:51 +00:00
# Binstubs
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a binstubs -d 'Install the binstubs of the listed gem'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command binstubs' -c bundle -l path -d 'Binstub destination directory (default bin)'
complete -f -n '__fish_bundle_using_command binstubs' -c bundle -l force -d 'Overwrite existing binstubs if they exist'
2014-10-26 17:18:51 +00:00
complete -f -n '__fish_bundle_using_command binstubs' -c bundle -a '(__fish_bundled_gems)'
2013-06-11 20:12:45 +00:00
# Exec
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a exec -d 'Execute a script in the context of the current bundle'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command exec' -c bundle -l keep-file-descriptors -d 'Exec runs a command, providing it access to the gems in the bundle'
2013-06-11 20:12:45 +00:00
# Help
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a help -d 'Describe available tasks or one specific task'
complete -f -n '__fish_bundle_using_command help' -c bundle -a install -d 'Install the gems specified by the Gemfile or Gemfile.lock'
complete -f -n '__fish_bundle_using_command help' -c bundle -a update -d 'Update dependencies to their latest versions'
complete -f -n '__fish_bundle_using_command help' -c bundle -a package -d 'Package .gem files into the vendor/cache directory'
2019-05-05 10:53:09 +00:00
complete -f -n '__fish_bundle_using_command help' -c bundle -a exec -d 'Execute a script in the context of the current bundle'
2020-03-09 18:36:12 +00:00
complete -f -n '__fish_bundle_using_command help' -c bundle -a config -d 'Specify and read configuration options for bundler'
complete -f -n '__fish_bundle_using_command help' -c bundle -a check -d 'Check bundler requirements for your application'
complete -f -n '__fish_bundle_using_command help' -c bundle -a list -d 'Show all of the gems in the current bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a show -d 'Show the source location of a particular gem in the bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a outdated -d 'Show all of the outdated gems in the current bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a console -d 'Start an IRB session in the context of the current bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a open -d 'Open an installed gem in your $EDITOR'
complete -f -n '__fish_bundle_using_command help' -c bundle -a viz -d 'Generate a visual representation of your dependencies'
complete -f -n '__fish_bundle_using_command help' -c bundle -a init -d 'Generate a simple Gemfile'
complete -f -n '__fish_bundle_using_command help' -c bundle -a gem -d 'Create a simple gem, suitable for development with bundler'
complete -f -n '__fish_bundle_using_command help' -c bundle -a platform -d 'Displays platform compatibility information'
complete -f -n '__fish_bundle_using_command help' -c bundle -a cleanup -d 'Cleans up unused gems in your bundler directory'
2013-06-11 20:12:45 +00:00
##
# Utilities
##
# Check
2021-05-28 16:50:01 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a check -d 'Check if the requirements are installed and available to bundler'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command check' -c bundle -l gemfile -d 'The location of the Gemfile bundler should use'
complete -f -n '__fish_bundle_using_command check' -c bundle -l path -d 'Specify a path other than the system default (BUNDLE_PATH or GEM_HOME)'
complete -f -n '__fish_bundle_using_command check' -c bundle -l dry-run -d 'Lock the Gemfile'
2013-06-11 20:12:45 +00:00
# List
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a list -d 'Show lists the names and versions of all gems that are required by your Gemfile'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command list' -c bundle -l paths -d 'List the paths of all gems required by your Gemfile'
2014-10-26 17:18:51 +00:00
complete -f -n '__fish_bundle_using_command list' -c bundle -a '(__fish_bundled_gems)'
2013-06-11 20:12:45 +00:00
# Show
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a show -d 'Show lists the names and versions of all gems that are required by your Gemfile'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command show' -c bundle -l paths -d 'List the paths of all gems required by your Gemfile'
2013-06-11 20:12:45 +00:00
complete -f -n '__fish_bundle_using_command show' -c bundle -a '(__fish_bundled_gems)'
# Outdated
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a outdated -d 'Show all of the outdated gems in the current bundle'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command outdated' -c bundle -l pre -d 'Check for newer pre-release gems'
complete -f -n '__fish_bundle_using_command outdated' -c bundle -l source -d 'Check against a specific source'
complete -f -n '__fish_bundle_using_command outdated' -c bundle -l local -d 'Use cached gems instead of attempting to fetch gems remotely'
complete -f -n '__fish_bundle_using_command outdated' -c bundle -l strict -d 'Only list newer versions allowed by your Gemfile requirements'
2013-06-11 20:12:45 +00:00
complete -f -n '__fish_bundle_using_command outdated' -c bundle -a '(__fish_bundled_gems)'
# Console
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a console -d 'Start an IRB session in the context of the current bundle'
2013-06-11 20:12:45 +00:00
# Open
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a open -d 'Open an installed gem in your $EDITOR'
2013-06-11 20:12:45 +00:00
complete -f -n '__fish_bundle_using_command open' -c bundle -a '(__fish_bundled_gems)'
# Viz
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a viz -d 'Generate a visual representation of your dependencies'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command viz' -c bundle -s f -l file -d 'The name to use for the generated file (see format option)'
complete -f -n '__fish_bundle_using_command viz' -c bundle -s v -l version -d 'Show each gem version'
complete -f -n '__fish_bundle_using_command viz' -c bundle -s r -l requirements -d 'Show the version of each required dependency'
complete -f -n '__fish_bundle_using_command viz' -c bundle -s F -l format -d 'Output a specific format (png, jpg, svg, dot, …)'
2013-06-11 20:12:45 +00:00
# Init
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a init -d 'Generate a simple Gemfile, placed in the current directory'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command init' -c bundle -l gemspec -d 'Use a specified .gemspec to create the Gemfile'
2013-06-11 20:12:45 +00:00
# Gem
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a gem -d 'Create a simple gem, suitable for development with bundler'
2019-05-05 10:53:09 +00:00
complete -f -n '__fish_bundle_using_command gem' -c bundle -s b -l bin -d 'Generate a binary for your library'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command gem' -c bundle -s t -l test -d 'Generate a test directory for your library (rspec or minitest)'
complete -f -n '__fish_bundle_using_command gem' -c bundle -s e -l edit -d 'Path to your editor'
complete -f -n '__fish_bundle_using_command gem' -c bundle -l ext -d 'Generate the boilerplate for C extension code'
2013-06-11 20:12:45 +00:00
# Platform
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a platform -d 'Displays platform compatibility information'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command platform' -c bundle -l ruby -d 'Only display Ruby directive information'
2013-06-11 20:12:45 +00:00
# Clean
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a clean -d 'Cleans up unused gems in your bundler directory'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command clean' -c bundle -l dry-run -d 'Only print out changes, do not actually clean gems'
complete -f -n '__fish_bundle_using_command clean' -c bundle -l force -d 'Forces clean even if --path is not set'
2014-10-26 17:18:51 +00:00
# Cache
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a cache -d 'Cache all the gems to vendor/cache'
2017-10-11 17:17:35 +00:00
complete -f -n '__fish_bundle_using_command cache' -c bundle -l no-prune -d 'Do not remove stale gems from the cache'
complete -f -n '__fish_bundle_using_command cache' -c bundle -l all -d 'Include all sources (including path and git)'
2014-10-26 17:18:51 +00:00
# Licenses
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a licenses -d 'Prints the license of all gems in the bundle'
2014-10-26 17:18:51 +00:00
# Env
2020-03-09 18:36:12 +00:00
complete -f -n __fish_bundle_no_command -c bundle -a env -d 'Print information about the environment Bundler is running under'