diff --git a/wp-cli-2.5.0.phar b/wp-cli-2.5.0.phar deleted file mode 100644 index 1503b06..0000000 --- a/wp-cli-2.5.0.phar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be0853e9f443f3848566070871d344e8ad81eb1e15d15dcf9324b4a75e272789 -size 6094557 diff --git a/wp-cli-2.8.1.phar b/wp-cli-2.8.1.phar new file mode 100644 index 0000000..52077b2 --- /dev/null +++ b/wp-cli-2.8.1.phar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8503cd579480d0cb237b4bef35e0c3da11c2ab872a1bc8f26d2da0ca0729b6a7 +size 6928461 diff --git a/wp-cli.spec b/wp-cli.spec index 41dce2d..2299d4f 100644 --- a/wp-cli.spec +++ b/wp-cli.spec @@ -1,14 +1,15 @@ %define name2 wp Name: wp-cli -Version: 2.5.0 -Release: 3%{?dist} +Version: 2.8.1 +Release: 0%{?dist} Summary: The command line interface for WordPress License: MIT URL: http://%{name}.org/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.phar Source1: LICENSE Source2: wp.1 +Source3: wp-completion.bash BuildArch: noarch %description @@ -34,6 +35,7 @@ install -p -m 0755 %{SOURCE0} %{buildroot}%{_bindir}/%{name2} cp -f %SOURCE1 LICENSE mkdir -p %{buildroot}%{_mandir}/man1 install -p -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/ +install -p -m 0644 %{SOURCE3} %{buildroot}%{bash_completion_dir}/ %files diff --git a/wp-completion.bash b/wp-completion.bash new file mode 100644 index 0000000..9df572b --- /dev/null +++ b/wp-completion.bash @@ -0,0 +1,23 @@ +# bash completion for the `wp` command + +_wp_complete() { + local OLD_IFS="$IFS" + local cur=${COMP_WORDS[COMP_CWORD]} + + IFS=$'\n'; # want to preserve spaces at the end + local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" + + if [[ "$opts" =~ \\s* ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + elif [[ $opts = "" ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + else + COMPREPLY=( ${opts[*]} ) + fi + + IFS="$OLD_IFS" + return 0 +} +complete -o nospace -F _wp_complete wp