fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmReformat share/**.fish with newlines collapsed78c948282

master
3.9 KiB73 linesraw
1############
2# COMMANDS #
3############
4
5# 1. In general it's not recommended to run commands one by one, because sbt startup is quite slow
6# 2. Only commands without arguments are completed, because any commands with args have to be quoted: `sbt "show key"`
7# 3. Only those commands are completed that could be useful to run as one off, like `sbt new ...`, the rest should be run in an interactive sbt shell
8# 4. Tasks is somewhat dynamic and depends on the project definition, so only most common are offered
9# 5. Same about settings (none are offered)
10
11# These commands can be combined in any order
12complete -c sbt -f -a '(string split "\n" "
13    about            Display basic information about sbt and the build
14    clean            Delete files produced by the build
15    compile          Compile sources
16    console          Scala REPL: project classes
17    consoleQuick     Scala REPL: only project dependencies
18    doc              Generate API documentation
19    help             Display help message
20    package          Produce the main artifact
21    plugins          List currently available plugins
22    projects         List the names of available projects
23    publish          Publish artifacts to a repository
24    publishLocal     Publish artifacts to the local Ivy repository
25    publishM2        Publish artifacts to the local Maven repository
26    run              Run a main class
27    settings         List the settings defined for the current project
28    shell            Launch an interactive sbt prompt
29    tasks            List the tasks defined for the current project
30    test             Execute all tests
31" | string trim | string replace -r "\s+" "\t")' \
32    -n 'not contains -- "new" (commandline -cpx);
33    and not contains -- "client" (commandline -cpx)'
34
35# These cannot be combined with any other commands and require an argument
36complete -c sbt -f -n 'test  (count (commandline -cpx)) = 1 ' -a new -d 'Create a new sbt project from the given template'
37complete -c sbt -f -n 'test  (count (commandline -cpx)) = 1 ' -a client -d 'Connect to a server with an interactive sbt prompt'
38
39###########
40# OPTIONS #
41###########
42
43# This is based on the output of `sbt -help`:
44
45# general options without arguments
46complete -c sbt -o help -s h -f -d "Print options help message"
47complete -c sbt -o verbose -s v -f -d "Print more details"
48complete -c sbt -o debug -s d -f -d "Set log level to debug"
49complete -c sbt -o no-colors -f -d "Disable ANSI color codes"
50complete -c sbt -o sbt-create -f -d "Launch even if there's no sbt project"
51complete -c sbt -o no-share -f -d "Use all local caches"
52complete -c sbt -o no-global -f -d "Use global caches, but not global ~/.sbt directory"
53complete -c sbt -o batch -f -d "Disable interactive mode"
54
55# general options with arguments
56complete -c sbt -o sbt-dir -d "Specify path to global settings/plugins" -r # path
57complete -c sbt -o sbt-boot -d "Specify path to shared boot directory" -r # path
58complete -c sbt -o ivy -d "Specify path to local Ivy repository" -r # path
59complete -c sbt -o mem -d "Set memory options" -x # integer? (default: -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxPermSize=256m)
60complete -c sbt -o port -d "Turn on JVM debugging, open at the given port" -r # port
61
62# sbt version
63complete -c sbt -o sbt-version -d "Use specified version of sbt" -x -a '0.13.(seq 0 6)\t"" 1.0.0\t""'
64complete -c sbt -o sbt-jar -d "Use specified jar as the sbt launcher" -r # jar path
65complete -c sbt -o sbt-rc -d "Use an RC version of sbt" -f
66complete -c sbt -o sbt-snapshot -d "Use a snapshot version of sbt" -f
67
68# java-related
69complete -c sbt -o java-home -d "Alternate JAVA_HOME" -r # path
70complete -c sbt -o D -d "Pass -D option directly to the Java runtime" -x # -Dkey=val
71complete -c sbt -o J-X -d "Pass -X option directly to the Java runtime" -x # -X*
72complete -c sbt -o S-X -d "Pass -X option to sbt's scalacOptions" -x # -X*
73# TODO: list available -X options if it's possible to do in an automatic way