Commit Graph

2117 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
56abb1750b Coalesce string trim and string match in flatpak completions
(cherry picked from commit 1a3adf086d)
2017-10-11 06:25:25 +02:00
Mahmoud Al-Qudsi
f6bb384a46 Update flatpak completions to work with latest flatpak
Closes #4456

(cherry picked from commit 21473b20ec)
2017-10-11 06:25:25 +02:00
Mahmoud Al-Qudsi
d4ed2ca447 Correct string replace usage in pip2/3 completions
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.

(cherry picked from commit b61c4f1cbc)
2017-10-05 13:56:24 +02:00
Mahmoud Al-Qudsi
429bdce4f1 Document reasons for commmand name replacement in pip2/3 completions 2017-10-05 13:32:56 +02:00
Mahmoud Al-Qudsi
de45232a37 Fix copy-and-paste pip3 -> pip2 typo
Thanks @floam. See #4448

(cherry picked from commit 78fe53406e)
2017-10-05 13:28:35 +02:00
Mahmoud Al-Qudsi
d74d3f2ca4 Use string replace instead of sed with better regex for pip completions 2017-10-05 13:21:26 +02:00
Mahmoud Al-Qudsi
0c21efea55 fixup! Force correct names for pip2/pip3 command in completions
(cherry picked from commit af12bcb117)
2017-10-05 13:12:15 +02:00
Mahmoud Al-Qudsi
3f9273cc32 Force correct names for pip2/pip3 command in completions
Work around bug pypa/pip#4755
Don't expect all users to be running a version of pip2/3 that includes
the fix (once it's upstreamed). Will continue to work if/when pip2/3
emit the correct output. pip is already very slow at printing the
completions (see #4448) so the `sed` call overhead is neglible.
2017-10-05 13:07:11 +02:00
Aaron Gyes
df6a86913c pip completions: use builtin source rather than eval function. 2017-10-04 21:56:28 -07:00
Cristian Prieto
835a40bf56 Python's pip and pipenv completions (#4448)
* Add pip completion

 * We call native pip completion for fish if pip is installed

* Add pipenv completion

 * We call pipenv native completion if pipenv is installed

* Applied changes as requested by @floam

 * Changed usage of `test (command -v)` for just `command -sq`

* Add completions for pip2/3

 * In some systems pip is not aliased and we have pip2 and pip3
 * In those cases, we just load the completions for those commands

* Separate pip2/3 completions in their own file as requested by @floam
2017-10-04 21:16:12 -07:00
Aaron Gyes
417be25c69 Fix export returning 1 on success
Fixes #4435

(cherry picked from commit 1ef310c3a8)
2017-10-01 21:46:33 +08:00
Mahmoud Al-Qudsi
8fcbe1a105 Install custom LSS script to /usr/local/share/fish on make install
Decided to move doc_src/fish.lss to share/lynx.lss, which just makes
more sense all around. Accordingly, now using {$__fish_datadir} instead
of {$__fish_help_dir} in help.fish.

Makefile now installs the custom lss on make install

(cherry picked from commit 338311af1e)
2017-09-26 15:00:32 -05:00
Mahmoud Al-Qudsi
8692489326 Use a custom Lynx style sheet (LSS file) to work around Lynx bug
Lynx uses a very naïve method of applying styles to HTML elements by
hashing the element type and the class name to generate a map of
hash:style. After the hash is calculated, Lynx does not go back and
check whether or not the actual string values match the LSS properties.

See the following links on the Links mailing list:
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00037.html
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00039.html

This patch copies the default Lynx stylesheet but removes highlighting
and other styles that would result in unreadable text (due to not enough
contrast with the background color), and if the `help` builtin detects
that the best web browser to use is Lynx, it instructs it to use this
modified stylesheet.

(cherry picked from commit 8b858f2fcc)
2017-09-26 15:00:18 -05:00
Mahmoud Al-Qudsi
c7771bb0dd Don't use xdg-open if running in terminal mode (i.e. no Xorg)
If the $DISPLAY environment variable is not set, xdg-open should not be
used to load the web browser. Just because it is installed does not mean
that the user exclusively runs in an X session.

Needed for Lynx detection to work around #4170

(cherry picked from commit 2b425ad221)
2017-09-26 14:52:18 -05:00
Mahmoud Al-Qudsi
67e3bac583 Speed up __fish_print_hostnames for faster completions
Thanks to @ThomasAH, as per #4378. Tested on many platforms (OS X,
FreeBSD, Linux, and Solaris). Works with IPv4 and IPv6 as well as
host names and loopback addresses.

(cherry picked from commit 3b3bcc998e)
2017-09-26 09:27:58 -05:00
Mahmoud Al-Qudsi
fc80505ecc Support colored ls output on Solaris 11
Closes #1223

(cherry picked from commit 6513db35c1)
2017-09-26 08:56:17 -05:00
Mahmoud Al-Qudsi
9d7a0de4c1 Squashed commit of the following:
commit e07f1d59c06094846db8ce59f65d4790b222fffa
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 21:54:45 2017 -0500

    Use git branch and git branch --remote for checkout completions

commit 9e1632236be065e051e306b11082ca4e9c7a0ee1
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 11:27:30 2017 -0500

    Correct classification of remote and local branches

    To prevent any breakage, no changes were made to __fish_git_branches,
    instead its output was filtered into __fish_git_remote_branches and
    __fish_git_local_branches, the two of which are now used to provide
    completions for "git checkout ..."

    Fixes #4395

Closes #4396
2017-09-14 13:46:03 -05:00
Mahmoud Al-Qudsi
7113cc33f1 Make s3cmd completions compatible with python3 environment
It seems that under python3, s3cmd emits its output as a long list (like
ls -l) with or without the --long parameter to "s3cmd ls s3://...".

This patch includes only s3://* paths from that output as completions.
2017-09-14 13:44:31 -05:00
Moritz
248de41d70 Add completions for git checkout --ours/--theirs (#4380)
* Add completions for git checkout --ours/--theirs

* Change description for `git checkout --ours/--theirs´ completions

(cherry picked from commit 6145b4a770)
2017-09-10 00:07:40 +08:00
Fabian Homborg
32e65ed301 __fish_print_hostnames: Improve ssh known_hosts extraction
This now includes hosts with custom ports (and other hosts with the
same key), and explicitly excludes negated hosts, those with a
wildcard and those with an `@`-marker (e.g. `@revoked`)

It's also possibly a bit quicker because the ordering is better,
especially for files with many comments.
2017-09-07 16:24:36 +02:00
Fabian Homborg
57753c7303 __fish_print_hostnames: Use source instead of eval
Since this doesn't need stdin, we can skip eval's overhead.
2017-09-07 16:24:36 +02:00
Fabian Homborg
4437e8d8d6 __fish_print_hostnames: Use string replace -f
Saves one `string match` invocation.

Also removes a useless-use-of-cat.
2017-09-07 16:24:36 +02:00
Fabian Homborg
a4c03e3d7b ssh completions: Don't call __fish_print_hostnames twice
Saves about 40% of the time in this completion.
2017-09-07 16:24:36 +02:00
Fabian Homborg
2137e197fc git completions: Use modified files in the index for reset
Fixes #4329.

(cherry picked from commit c2f0a45d60)
2017-09-06 18:14:09 +08:00
Marcel Bischoff
7669c14274 Add basic ezjail-admin completion
(cherry picked from commit c0c33b3605)
2017-09-06 18:14:09 +08:00
Sam Yu
8eca1b0f13 Add repo completion for zypper (#4325)
* Add repo completion for zypper

* Replace sed with string in __fish_print_zypp_repos

* Move function into completion script

* Update zypper completion

add subcommand packages to __fish_zypper_repo_commands

(cherry picked from commit 81becc5f6b)
2017-09-06 18:14:09 +08:00
Fabian Homborg
908063d830 pacman-ish completions: Complete files for -Qo and -Qp
These were explicitly suppressed, which was wrong.
2017-09-05 16:55:06 +02:00
Benjamin Reitzammer
7d46c78082 add --force-with-lease completion for git push (#4368)
(cherry picked from commit 72244dee5b)
2017-09-01 23:31:03 +08:00
modula t. worm
3905c3355b Add completions for kdeconnect-cli (KDE Connect)
(cherry picked from commit fa3ca4dc3d)
2017-09-01 23:28:13 +08:00
Alexey Alekhin
d2c0cafeb7 Added sbt completions
(cherry picked from commit a43da0163a)
2017-09-01 23:28:13 +08:00
Radek SPRTA
27d7feaf95 Fix apt subcommand option completions 2017-08-22 21:46:28 -07:00
Mahmoud Al-Qudsi
f706081ea4 Replace custom s3cmd completion functions with standard __fish_* functions
Per the discussion with @faho in #4332, replaced some custom completion
state detection functions with standard __fish_* functions used in other
completion sources.
2017-08-18 11:55:16 -05:00
Mahmoud Al-Qudsi
7fe3cb7b29 fixup! Provide completions for s3cmd 2017-08-18 11:55:16 -05:00
Mahmoud Al-Qudsi
539acd9fc5 Provide completions for s3cmd
No longer auto-generated. Everything has been summarized. Supressing
file completions for initial command, providing list of valid initial
commands, filtering --options by subcommand.
2017-08-18 11:55:16 -05:00
Kurtis Rader
4b51e0f935 Fix typo in xdg-mime completion functions 2017-08-17 10:56:18 -07:00
MoritzKn
2761cf1bf5 Update xdg-mime helper
This will respect the `/usr/local/share/applications/` directory when
fetching mime infos.

Update xdg-mime helper to comply with the xdg spec.

This also makes sure __fish_print_xdg_applications_directories only prints
directories that exist.

Relevant specs:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
https://specifications.freedesktop.org/desktop-entry-spec/latest/ape.html
2017-08-17 10:55:42 -07:00
Matus Goljer
3fe561bc93 Add completion for packages in update subcommand
This patch adds completion for the update subcommand, that is, when the
user types in `composer update <tab>`.

The code depends on python for the json parsing.  I'm not sure if this
is appropriate or if there is a fish-native way to parse json data.

Use suggestions for remove subcommand.

Add suggestions for why, why-not and depends.

Add why/why-not suggestion.
2017-08-17 10:28:14 -07:00
sentriz
c59e221bf1 Accept return as a valid answer to 'Edit the file again?'
Also, check for affirmative answer so a random string isn't taken as a
"yes" response.
2017-08-14 17:54:30 -07:00
Mahmoud Al-Qudsi
67f7e53237 Ignore more invalid arguments from parsed man pages
Specifically closes #4313.
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.
2017-08-11 13:54:41 -05:00
Fabian Homborg
219c7ec812 help: Fix error if no argument is given 2017-08-11 18:27:58 +02:00
Kurtis Rader
11f5bbf83d remove completions for . and source
These completions never actually worked and always fell back to the
builtin path completion. But a recent fix means that these now keep the
fallback from happening resulting in no completions for these commands.
2017-08-09 11:15:20 -07:00
Radek SPRTA
74cac0f86f completions for snap command 2017-08-07 18:47:37 -07:00
Alexey Alekhin
326f2affa4 Fixed functions -D/--details completion 2017-08-07 17:43:05 -07:00
Sam Yu
0988f53c70 Speedup git prompt
Fix __fish_git_prompt too slow under repo with lots of untracked
files when __fish_git_prompt_showuntrackedfiles enabled.
2017-08-04 20:43:07 -07:00
Raoul Wols
8e3a9c9585 Add Sublime Text 3 completions 2017-07-31 22:09:06 -07:00
Daniel K
d68b631919 fix check for existing variable 2017-07-29 21:18:44 -07:00
Kurtis Rader
4e026588f4 modify prev commit to use builtin cd
Using the `cd` function can have undesirable side effects like mucking
with the directory history. So force the use of the builtin cd.
2017-07-27 14:36:32 -07:00
Kurtis Rader
defdc92b57 fix ssh config Include file handling
Fixes #4253
2017-07-27 14:36:32 -07:00
Thales Mello
a071deaf61 Make npm run-script completion faster with jq (#4241)
* Make npm run-script completion faster with `jq`

When jq is available, it's actually faster to invoke jq and parse the `package.json`
invoking the `npm` command.

Also, prior to this commit, both `__fish_complete_npm` and `__fish_npm_run` were being run
whenever completions for `npm run` subcommand was being used, which was actually making
repetitive work (invoking npm command twice). This pull request is supposed to make completion
without `jq` faster as well

* Refactor npm.fish for code reutilization

Created function to handle both cases of npm run completion parse, with or without `jq` completion.

* Remove unecessary blank line
2017-07-26 13:31:35 +02:00
Kurtis Rader
92f39f7b89 fix bug introduced by commit 86af63cd3 2017-07-25 14:03:40 -07:00