Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RPM completion in dev19 and a suggested change to make completion



Hi,

I'm not au fait enough to do it by myself, but a suggestion for rpm
would be that it does not look into the RPM database if the -p
<package> option is specified, as it only applies to files. Is this
done in -dev20? Haven't had a look at it yet.

The other suggestion I have is to allow make completion to take GNU
make in acknowledgement:

--------
#compdef make gmake pmake

local prev="$words[CURRENT-1]" file ret=1 expl

if [[ "$prev" = -[CI] ]]; then
  _files -/
elif [[ "$prev" = -[foW] ]]; then
  _files
else
  file="$words[(I)-f]"
  if (( file )); then
    file="$words[file+1]"
  elif [[ -e Makefile ]]; then
    file=Makefile
  elif [[ -e makefile ]]; then
    file=makefile
  else
    file=''
  fi

  [[ -n "$file" ]] && _wanted targets expl 'make target' &&
      compadd "$expl[@]" - \
		$(make -f $file -p aaaaa 2>&1 | awk -F: '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}' | grep -v aaaaa) && ret=0

# This is the old code
#          $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
# 	      /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ {
# 	        print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
# 	     FS=: $file) && ret=0
  (( ret )) && { compset -P 1 '*='; _files }
fi
--------

With this, for example, make <TAB> in the kernel sources "sees" target
bzImage while it doesn't see it in the original version. Comments?

-- 
fg

# rm *;o
o: command not found



Messages sorted by: Reverse Date, Date, Thread, Author