everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: James Rowe <jnrowe@gmail.com>
Cc: dtas-all@nongnu.org
Subject: Re: zsh completion for dtas-ctl
Date: Sun, 3 Nov 2019 01:07:59 +0000	[thread overview]
Message-ID: <20191103010759.GA11361@dcvr> (raw)
In-Reply-To: <20191103003231.pivotxyv3k6kvqt4@gmail.com>

James Rowe <jnrowe@gmail.com> wrote:
> Hi,
>   Thanks to rb_optparse.zsh¹ completion is available for many of the
> dtas commands, however this isn't the case for dtas-ctl as its interface
> isn't built on optparse.
>   Attached is the first cut of a zsh completion script for dtas-ctl.  It
> doesn't include all the features, and it really isn't as smart as it
> should be.  It does Work For Me™.  I've pasted the CC0 header on to it
> should you wish to add it to the examples/ directory.

Wow, thank you for your time and effort in doing this!

I'm not a zsh user myself, but probably a examples/zsh-completion/
directory in preparation for other commands?

>   The obvious improvements are that it should be automatically
> generated, probably from the player protocol manpage or some such.

Yes, that would be nice, but see below.

> 1. https://github.com/ruby/ruby/blob/master/misc/rb_optparse.zsh

> #compdef dtas-ctl


> # To the extent possible under law, James Rowe has waived all copyright and
> # related or neighboring rights to this example.
> _arguments \
>     ':dtas-ctl command:((
>         cd\:"Change the current working directory of the player."
>         clear\:"Clear current queue."


>     ))' \
>     '*::subcmd:->subcmd' && return 0
> case "$words[1]" in
> (cd)
>     _arguments \
>         ':select dir:_path_files -/'
>     ;;
> (cue)
>     _arguments \
>         '1:dtas-ctl command:((
>             next\:"Skip to the next cue sheet offset."
>             prev\:"Skip to the previous cue sheet offset."
>             goto\:"Go to the cue index."
>             seek\:"Seek within the current cue index."
>         ))'
>     ;;

As a non-zsh user, this seems easy-to-follow, understand, and
maybe build a standalone-parser for.  So I'm kinda wondering
if a manpage could be generated from this, instead; along
with completions for bash and maybe other shells.

But it could also be a lot of work, so no obligations to do
this :)

  reply	other threads:[~2019-11-03  1:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-03  0:35 zsh completion for dtas-ctl James Rowe
2019-11-03  1:07 ` Eric Wong [this message]
2019-11-04  2:19   ` Eric Wong
2019-11-04  9:36     ` James Rowe

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:

  List information: https://80x24.org/dtas/README

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

  git send-email \
    --in-reply-to=20191103010759.GA11361@dcvr \
    --to=e@80x24.org \
    --cc=dtas-all@nongnu.org \
    --cc=jnrowe@gmail.com \


* 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


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 read-only IMAP folder(s) and NNTP newsgroup(s).