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

Re: [vincent@xxxxxxxxxx: Bug#269769: zsh: sabcmd completion doesn't work]



> schaefer<690> sabcmd
> Completing parameter name -
> Completing stylesheet -
> file1.xsl
> 
> I don't immediately know why an empty group is being created for parameter
> names even when there are no parameters to be completed.

That's odd.  Judging by the manpage, it looks as though the stylesheet
should always be the first non-option argument, and the valid name=value
assignments need to be parsed from that.

I'm tempted to do the following.

Index: Completion/Unix/Command/_sablotron
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sablotron,v
retrieving revision 1.2
diff -u -r1.2 _sablotron
--- Completion/Unix/Command/_sablotron	21 Jan 2004 13:53:29 -0000	1.2
+++ Completion/Unix/Command/_sablotron	3 Sep 2004 15:29:49 -0000
@@ -15,38 +15,4 @@
   $mopts{-c,--chain-xsl}'[single input file, multiple chained stylesheets]' \
   $mopts{-x,--batch-xml}'[single input file, multiple stylesheets]' \
   $mopts{-s,--batch-xsl}'[multiple input files, single stylesheet]' \
-  '*: :->arguments' && ret=0
-
-if [[ -n "$state" ]]; then
-  mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}"
-  [[ $mode = (chain|batch-[xs]) ]] || mode=default
-  _tags assignments files
-  while _tags; do
-    if _requested assignments; then
-      if [[ -prefix *= ]]; then
-        _message -e value value
-      else
-        _message -e parameter 'parameter name'
-      fi
-    fi
-    if _requested files; then
-      case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in
-        default:1|chain:<3->|batch-x:2|batch-s:1)
-	  _description files expl stylesheet
-	  _files "$expl[@]" -g "*.xsl(-.)" && ret=0
-	;;
-        default:2|chain:1|batch-x:1|batch-s:2)
-	  _description files expl 'input file'
-	  _files "$expl[@]" && ret=0
-	;;
-        default:3|chain:2|batch-x:<3->|batch-s:<3->)
-	  _description files expl 'output file'
-	  _files "$expl[@]" && ret=0
-	;;
-      esac
-    fi
-    (( ret )) || break
-  done
-fi
-
-return ret
+  ':::_files -g "*.xsl"' && ret=0



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