zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Cc: 269769@bugs.debian.org
Subject: Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work]
Date: Fri, 3 Sep 2004 11:31:25 -0400	[thread overview]
Message-ID: <20040903153125.GA29748@scowler.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0409030806430.28049@toltec.zanshin.com>

> 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


      parent reply	other threads:[~2004-09-03 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03 14:02 Clint Adams
2004-09-03 15:11 ` Bart Schaefer
2004-09-03 15:25   ` Oliver Kiddle
2004-09-03 15:33     ` Clint Adams
2004-09-03 15:31   ` Clint Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040903153125.GA29748@scowler.net \
    --to=clint@zsh.org \
    --cc=269769@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).