From 3707dcbf337f35eff1e1b73031f33f0dbfeafc25 Mon Sep 17 00:00:00 2001 From: "Arjun A.K" Date: Sun, 22 Dec 2013 18:28:24 +0530 Subject: [PATCH 1/6] configure.ac: Fix typo 'direcotry' => 'directory' --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 64a6f1ecb..5cc31af61 100644 --- a/configure.ac +++ b/configure.ac @@ -398,7 +398,7 @@ fi # installed # -AC_ARG_VAR( [docdir], [Documentation direcotry] ) +AC_ARG_VAR( [docdir], [Documentation directory] ) if test -z $docdir; then docdir=$datadir/doc/fish From a3a918e900ecd14bd1fb632f1ca558d3875a9b67 Mon Sep 17 00:00:00 2001 From: Andreas Eger Date: Fri, 6 Dec 2013 00:30:44 +0100 Subject: [PATCH 2/6] adding elixir, iex, mix completions --- share/completions/elixir.fish | 15 ++++++ share/completions/iex.fish | 16 ++++++ share/completions/mix.fish | 93 +++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 share/completions/elixir.fish create mode 100644 share/completions/iex.fish create mode 100644 share/completions/mix.fish diff --git a/share/completions/elixir.fish b/share/completions/elixir.fish new file mode 100644 index 000000000..f59045860 --- /dev/null +++ b/share/completions/elixir.fish @@ -0,0 +1,15 @@ +complete -f -c elixir -s v -d "Prints version and exit" +complete -f -c elixir -s e -d "Evaluates the given command" +complete -c elixir -s r -d "Requires the given files/patterns" +complete -c elixir -s S -d "Finds and executes the given script" +complete -c elixir -s pr -d "Requires the given files/patterns in parallel" +complete -c elixir -s pa -d "Prepends the given path to Erlang code path" +complete -c elixir -s pz -d "Appends the given path to Erlang code path" +complete -c elixir -l app -d "Start the given app and its dependencies" +complete -f -c elixir -l erl -d "Switches to be passed down to erlang" +complete -f -c elixir -l name -d "Makes and assigns a name to the distributed node" +complete -f -c elixir -l sname -d "Makes and assigns a short name to the distributed node" +complete -f -c elixir -l cookie -d "Sets a cookie for this distributed node" +complete -f -c elixir -l hidden -d "Makes a hidden node" +complete -f -c elixir -l detached -d "Starts the Erlang VM detached from console" +complete -f -c elixir -l no-halt -d "Does not halt the Erlang VM after execution" diff --git a/share/completions/iex.fish b/share/completions/iex.fish new file mode 100644 index 000000000..199a53280 --- /dev/null +++ b/share/completions/iex.fish @@ -0,0 +1,16 @@ +complete -f -c iex -s v -d "Prints version and exit" +complete -f -c iex -s e -d "Evaluates the given command" +complete -c iex -s r -d "Requires the given files/patterns" +complete -c iex -s S -d "Finds and executes the given script" +complete -c iex -s pr -d "Requires the given files/patterns in parallel" +complete -c iex -s pa -d "Prepends the given path to Erlang code path" +complete -c iex -s pz -d "Appends the given path to Erlang code path" +complete -c iex -l app -d "Start the given app and its dependencies" +complete -f -c iex -l erl -d "Switches to be passed down to erlang" +complete -f -c iex -l name -d "Makes and assigns a name to the distributed node" +complete -f -c iex -l sname -d "Makes and assigns a short name to the distributed node" +complete -f -c iex -l cookie -d "Sets a cookie for this distributed node" +complete -f -c iex -l hidden -d "Makes a hidden node" +complete -f -c iex -l detached -d "Starts the Erlang VM detached from console" +complete -f -c iex -l remsh -d "Connects to a node using a remote shell" +complete -c iex -l dot-iex -d "Overrides default .iex file and uses path instead; path can be empty, then no file will be loaded" \ No newline at end of file diff --git a/share/completions/mix.fish b/share/completions/mix.fish new file mode 100644 index 000000000..ba71c2a22 --- /dev/null +++ b/share/completions/mix.fish @@ -0,0 +1,93 @@ +function __fish_mix_needs_command + set cmd (commandline -opc) + if [ (count $cmd) -eq 1 -a $cmd[1] = 'mix' ] + return 0 + end + return 1 +end + +function __fish_mix_using_command + set cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + + +complete -f -c mix -n '__fish_mix_needs_command' -a archive -d "Archive this project into a .ez file" +complete -f -c mix -n '__fish_mix_needs_command' -a clean -d "Clean generated application files" +complete -f -c mix -n '__fish_mix_needs_command' -a cmd -d "Executes the given command" +complete -c mix -n '__fish_mix_needs_command' -a compile -d "Compile source files" +complete -f -c mix -n '__fish_mix_needs_command' -a deps -d "List dependencies and their status" +complete -f -c mix -n '__fish_mix_needs_command' -a deps.clean -d "Remove the given dependencies' files" +complete -f -c mix -n '__fish_mix_needs_command' -a deps.compile -d "Compile dependencies" +complete -f -c mix -n '__fish_mix_needs_command' -a deps.get -d "Get all out of date dependencies" +complete -f -c mix -n '__fish_mix_needs_command' -a deps.unlock -d "Unlock the given dependencies" +complete -f -c mix -n '__fish_mix_needs_command' -a deps.update -d "Update the given dependencies" +complete -f -c mix -n '__fish_mix_needs_command' -a do -d "Executes the tasks separated by comma" +complete -f -c mix -n '__fish_mix_needs_command' -a escriptize -d "Generates an escript for the project" +complete -f -c mix -n '__fish_mix_needs_command' -a help -d "Print help information for tasks" +complete -c mix -n '__fish_mix_needs_command' -a local -d "List local tasks" +complete -c mix -n '__fish_mix_needs_command' -a local.install -d "Install a task or an archive locally" +complete -c mix -n '__fish_mix_needs_command' -a local.rebar -d "Install rebar locally" +complete -c mix -n '__fish_mix_needs_command' -a local.uninstall -d "Uninstall local tasks or archives" +complete -c mix -n '__fish_mix_needs_command' -a new -d "Creates a new Elixir project" +complete -f -c mix -n '__fish_mix_needs_command' -a run -d "Run the given file or expression" +complete -f -c mix -n '__fish_mix_needs_command' -a test -d "Run a project's tests" + +# archive subcommand +complete -f -c mix -n '__fish_mix_using_command archive' -s o -d "specify output file name" +complete -f -c mix -n '__fish_mix_using_command archive' -l no-compile -d "skip compilation" + +# clean subcommand +complete -f -c mix -n '__fish_mix_using_command clean' -l all -d "Clean everything, including dependencies" + +# escriptize subcommand +complete -f -c mix -n '__fish_mix_using_command escriptize' -l force -d "forces compilation regardless of modification times" +complete -f -c mix -n '__fish_mix_using_command escriptize' -l no-compile -d "skips compilation to .beam files" + +# new subcommand +complete -f -c mix -n '__fish_mix_using_command new' -l bare -d "can be given to not generate an OTP application skeleton" +complete -f -c mix -n '__fish_mix_using_command new' -l module +complete -f -c mix -n '__fish_mix_using_command new' -l umbrella -d "can be given to generate an umbrella project" + +# run subcommand +complete -c mix -n '__fish_mix_using_command run' -l eval -s e -d "Evaluates the given code" +complete -c mix -n '__fish_mix_using_command run' -l require -s r -d "Requires pattern before running the command" +complete -c mix -n '__fish_mix_using_command run' -l parallel-require -s pr -d "Requires pattern in parallel" +complete -c mix -n '__fish_mix_using_command run' -l no-halt -d "Does not halt the system after running the command" +complete -c mix -n '__fish_mix_using_command run' -l no-compile -d "Does not compile even if files require compilation" +complete -c mix -n '__fish_mix_using_command run' -l no-start -d "Does not start applications after compilation" + +# test subcommand +complete -c mix -n '__fish_mix_using_command test' -l trace -d "run tests with detailed reporting. Automatically sets `--max-cases` to 1" +complete -c mix -n '__fish_mix_using_command test' -l max-cases -d "set the maximum number of cases running async" +complete -c mix -n '__fish_mix_using_command test' -l cover -d "the directory to include coverage results" +complete -c mix -n '__fish_mix_using_command test' -l force -d "forces compilation regardless of modification times" +complete -c mix -n '__fish_mix_using_command test' -l no-compile -d "do not compile, even if files require compilation" +complete -c mix -n '__fish_mix_using_command test' -l no-start -d "do not start applications after compilation" +complete -c mix -n '__fish_mix_using_command test' -l no-color -d "disable color in the output" + +# help subcommand +complete -f -c mix -n '__fish_mix_using_command help' -a archive -d "Archive this project into a .ez file" +complete -f -c mix -n '__fish_mix_using_command help' -a clean -d "Clean generated application files" +complete -f -c mix -n '__fish_mix_using_command help' -a cmd -d "Executes the given command" +complete -f -c mix -n '__fish_mix_using_command help' -a compile -d "Compile source files" +complete -f -c mix -n '__fish_mix_using_command help' -a deps -d "List dependencies and their status" +complete -f -c mix -n '__fish_mix_using_command help' -a deps.clean -d "Remove the given dependencies' files" +complete -f -c mix -n '__fish_mix_using_command help' -a deps.compile -d "Compile dependencies" +complete -f -c mix -n '__fish_mix_using_command help' -a deps.get -d "Get all out of date dependencies" +complete -f -c mix -n '__fish_mix_using_command help' -a deps.unlock -d "Unlock the given dependencies" +complete -f -c mix -n '__fish_mix_using_command help' -a deps.update -d "Update the given dependencies" +complete -f -c mix -n '__fish_mix_using_command help' -a do -d "Executes the tasks separated by comma" +complete -f -c mix -n '__fish_mix_using_command help' -a escriptize -d "Generates an escript for the project" +complete -f -c mix -n '__fish_mix_using_command help' -a local -d "List local tasks" +complete -f -c mix -n '__fish_mix_using_command help' -a local.install -d "Install a task or an archive locally" +complete -f -c mix -n '__fish_mix_using_command help' -a local.rebar -d "Install rebar locally" +complete -f -c mix -n '__fish_mix_using_command help' -a local.uninstall -d "Uninstall local tasks or archives" +complete -f -c mix -n '__fish_mix_using_command help' -a new -d "Creates a new Elixir project" +complete -f -c mix -n '__fish_mix_using_command help' -a run -d "Run the given file or expression" +complete -f -c mix -n '__fish_mix_using_command help' -a test -d "Run a project's tests" From 93f7c14ea6018d60b6e3c561e52e6aee74396cc1 Mon Sep 17 00:00:00 2001 From: Derek Li Date: Fri, 13 Dec 2013 15:00:17 +0800 Subject: [PATCH 3/6] Math: disable bc multi-line output. --- share/functions/math.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/math.fish b/share/functions/math.fish index bad349d93..b262fd3bd 100644 --- a/share/functions/math.fish +++ b/share/functions/math.fish @@ -7,7 +7,7 @@ function math --description "Perform math calculations in bc" return 0 end - set -l out (echo $argv|bc) + set -l out (echo $argv|env BC_LINE_LENGTH=0 bc) echo $out switch $out case 0 From 541db5fbbea9cbe4412472621965515b2297e9c2 Mon Sep 17 00:00:00 2001 From: maxried Date: Sat, 28 Dec 2013 12:24:58 +0100 Subject: [PATCH 4/6] Update adb.fish Added semi-documented but often used adb subcommand. --- share/completions/adb.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/completions/adb.fish b/share/completions/adb.fish index 0eef3421f..bea9c784a 100644 --- a/share/completions/adb.fish +++ b/share/completions/adb.fish @@ -98,6 +98,7 @@ complete -f -n '__fish_adb_no_subcommand' -c adb -a 'root' -d 'Restart the adbd complete -f -n '__fish_adb_no_subcommand' -c adb -a 'usb' -d 'Restart the adbd daemon listening on USB' complete -f -n '__fish_adb_no_subcommand' -c adb -a 'tcpip' -d 'Restart the adbd daemon listening on TCP' complete -f -n '__fish_adb_no_subcommand' -c adb -a 'ppp' -d 'Run PPP over USB' +complete -f -n '__fish_adb_no_subcommand' -c adb -a 'sideload' -d 'Install zip-file on device in sideload mode' # install options complete -n '__fish_seen_subcommand_from install' -c adb -s l -d 'Forward-lock the app' From 8078d29fdaa9d138d0b28b0e84e1d7c0279afbd3 Mon Sep 17 00:00:00 2001 From: Mandeep Sandhu Date: Fri, 20 Dec 2013 16:58:20 +0530 Subject: [PATCH 5/6] Fix completion bug for special fish characters. Issue #1108: If there are special characters like '{' in the completion suggestions, then we fail to parse it successfully as we are passing an unescaped version of the character to parser_t::eval_args(...). This causes us to retun w/o completion suggestions. This bug was discovered while implementing 'git stash' completion as the suggestion contained strings like 'stash@\{0\}'. Th fix is to properly escape the string before parsing it. --- complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/complete.cpp b/complete.cpp index ed0fc102d..7c3445571 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1240,7 +1240,7 @@ void completer_t::complete_from_args(const wcstring &str, if (! is_autosuggest) proc_pop_interactive(); - this->complete_strings(str, desc.c_str(), 0, possible_comp, flags); + this->complete_strings(escape_string(str, ESCAPE_ALL), desc.c_str(), 0, possible_comp, flags); } /** From 1efb1202487620dbee5f0f5b527809c894ee60ad Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 30 Dec 2013 12:32:24 +0800 Subject: [PATCH 6/6] __fish_complete_svn: remove GNU extension options Continuation of https://github.com/fish-shell/fish-shell/pull/1195/. Removes use of --delimiter and --fields with cut(1) as these are GNU extensions. Note that a number of completions use these options, but as they are only for GNU/Linux-specific tools have remained unmodified. --- share/functions/__fish_complete_svn.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_complete_svn.fish b/share/functions/__fish_complete_svn.fish index 51030313d..7fcc3f693 100644 --- a/share/functions/__fish_complete_svn.fish +++ b/share/functions/__fish_complete_svn.fish @@ -298,12 +298,12 @@ function __fish_complete_svn -d 'Complete svn and its wrappers' --argument-names # # Completions for the 'relocate' subcommand # - _svn_cmpl_ $relocate -xa '( svn info | grep URL: | cut --delimiter " " --fields 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' + _svn_cmpl_ $relocate -xa '( svn info | grep URL: | cut -d " " -f 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' # # Completions for the 'switch', 'sw' subcommands # - _svn_cmpl_ $switch -l relocate --description 'Relocate via URL-rewriting' -xa '( svn info | grep URL: | cut --delimiter " " --fields 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' + _svn_cmpl_ $switch -l relocate --description 'Relocate via URL-rewriting' -xa '( svn info | grep URL: | cut -d " " -f 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' # # Completions for the 'status', 'st' subcommands