From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 32D7E1F454 for ; Sun, 3 Nov 2019 00:36:12 +0000 (UTC) Received: from localhost ([::1]:51402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iR3sI-00057A-SN for e@80x24.org; Sat, 02 Nov 2019 20:36:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iR3sG-00056z-Jr for dtas-all@nongnu.org; Sat, 02 Nov 2019 20:36:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iR3sF-0004Ru-5U for dtas-all@nongnu.org; Sat, 02 Nov 2019 20:36:08 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iR3sE-0004J4-Rr for dtas-all@nongnu.org; Sat, 02 Nov 2019 20:36:07 -0400 Received: by mail-wm1-x32d.google.com with SMTP id c17so5655273wmk.2 for ; Sat, 02 Nov 2019 17:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=fMrP3V8gZCMFYpZ6wkfj2O9B9svincg7vD7yGX2kZiM=; b=h729UvN9dN7fT/7UTALnnt5V11bXzBk7gGqCY5lpyHq05ZhWsyBojH+6eP68fPDU7w E1O4UkGH3+NiVoWpybA8XzOUTZXkwrhmtiUPvc8qNGRuznuNugGZuuvV3eLKP0qrZKo1 vSYaUavdau6PWPGv68SkV/YSlK6haSpaDnBAS2FtAE9Dv371DWO64t6SOyxrGBPbUqE3 cAleewILFYOKaX9G3i6lJWn7vqYxJdbVM9UkxmrhkIcJo57VxSZiYRQ9s/s6knt8KjlL +gZBfwY3WFLZExy/S38qHsAJrS3myrIPPMesy1ryvkQeoh5ljKqvinamT53ear1HJqeP kt+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=fMrP3V8gZCMFYpZ6wkfj2O9B9svincg7vD7yGX2kZiM=; b=W8Z7RoBa/7R3XaLoDOmFFj5ltY2cdq4cG2vJ6gO8K2mSpN57F7pcaWlYxLKcZgjEVt mal2cw+J2xF+odOXuMlD30Uxi1T/RqOUXdbaFWza99mvQdycq/c+EP0lnp98OU/MBKuA yHbNTMTB5nUvzd/8yT0oCH2H4I3WNVyfF2lG7ACbxzzRSnxIoJ0n8frX/3W3tyD6o2oE WbD6AqGoybEQebQRxgnO/HE8CV4YC2UiL7ypVKjeUwKSK0Mu6vRuxv0VWjwLeB+dX9Lw KMdaXsHLiknFPtCw7jiveYGtSP8SkgOCJP0sMPu3SjmJkRYOS0srsKhCBpZU+b2U3ZuP 25Ug== X-Gm-Message-State: APjAAAWAtokzdYcfIAfc6nv7PnzVbUnKzOYfeNAg/VFbNC8E+M3L44TJ xz/ZYC0u5UvcAm3FcWEwc6O48cPM X-Google-Smtp-Source: APXvYqyM3zAfDZQMsaf5k6MsADkITvei4CjoBv5eZuIJBKRLX99BpIDHFV7oSqV+SsPLxT+QAK8YTg== X-Received: by 2002:a1c:a548:: with SMTP id o69mr2538454wme.31.1572741364617; Sat, 02 Nov 2019 17:36:04 -0700 (PDT) Received: from localhost (188.30.152.112.threembb.co.uk. [188.30.152.112]) by smtp.gmail.com with ESMTPSA id l18sm15546666wrn.48.2019.11.02.17.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2019 17:36:03 -0700 (PDT) Date: Sun, 3 Nov 2019 00:35:51 +0000 From: James Rowe To: dtas-all@nongnu.org Subject: zsh completion for dtas-ctl Message-ID: <20191103003231.pivotxyv3k6kvqt4@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nc4aiwn63qlfofwq" Content-Disposition: inline User-Agent: NeoMutt/20180716 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" --nc4aiwn63qlfofwq Content-Type: multipart/mixed; boundary="c24akeeebkpshzts" Content-Disposition: inline --c24akeeebkpshzts Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Thanks to rb_optparse.zsh=C2=B9 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=E2=84=A2. I've pasted the CC0 header on to= it should you wish to add it to the examples/ directory. The obvious improvements are that it should be automatically generated, probably from the player protocol manpage or some such. Thanks, James 1. https://github.com/ruby/ruby/blob/master/misc/rb_optparse.zsh --=20 =E2=98=92 Vote to destroy email signatures today! --c24akeeebkpshzts Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=_dtas-ctl #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." cue\:"Display the index/offsets of the embedded CUE sheet." current\:"Output information about the current track/command in YAML." enq\:"Enqueue the given FILENAME for playback." enq-cmd\:"Run the following command for playback." env\:"Set/unset environment variables." format\:"Configure the format between source and sink." pause\:"Pause playback." play\:"Restart playback from pause." play_pause\:"Toggle the play/pause state." queue\ cat\:"Dump the contents of the queue as YAML." restart\:"Restarts all processes in the current pipeline." rg\:"Configure ReplayGain support." seek\:"Seek the current track to a specified time." skip\:"Abort current track/command." sink\:"Control sinks." source\:"Control sources." state\ dump\:"Immediately dump the state of the player." tl\:"Control tracklist." trim\:"Limits playback of all tracks in the tracklist." watch\:"Adds the client to the passive watch list for notifications." ))' \ '*::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." ))' ;; (enq|state dump) _arguments \ ':select file:_files' ;; (format) _arguments \ 'channels=[Number of channels to use internally.]' \ 'endian=[Change endianess.]:select endianess:(big little swap)' \ 'bits=[Sample precision.]:select precision:(16 bypass)' \ 'rate=[Sample rate of audio.]:select sample rate:(44100 48000 bypass)' \ 'type=[Change the raw PCM format.]:select raw PCM format:(s16 s24 s32 u16 u24 u32 f32 f64)' ;; (rg) _arguments \ 'fallback_gain=[Adjust the volume by this level for tracks.]:select adjustment:_guard "-?[0-9]#" "dB value"' \ 'fallback_track=[When in album_gain mode, fallback to track_gain.]:select option:(true false)' \ 'mode=[Controls the ReplayGain tag to use.]:(album_gain track_gain track_norm album_norm off)' \ 'preamp=[Adjust the album_gain or track_gain.]:select adjustment:_guard "-?[0-9]#" "dB value"' \ 'norm_level=[Control the level to normalize.]:select level:_guard "-?[0-9]#" "dB value"' ;; (seek) _arguments \ '1:select track:_guard "[0-9]#" "track number"' ;; (sink) _arguments \ ':sink subcommand:(( ls\:"List names of current sinks." cat\:"Dump SINKNAME config in YAML." rm\:"Remove SINKNAME." ed\:"create/edit SINKNAME." ))' ;; (source) _arguments \ ':source subcommand:(( cat\:"Dump the current source command and env in YAML." ed\:"Edit the source parameters." ls\:"Dump the names of sources sorted by tryorder." restart\:"Restart the current source command." ))' ;; (tl) _arguments \ ':tl subcommand:(( add\:"Add files to the tracklist." clear\:"Clear current tracklist." consume\:"Show/or change consume status of the tracklist." current\:"Display the pathname to the currently playing track." current-id\:"Display the TRACKID of the currently playing track." remove\:"Remove the track with the given TRACKID from the track list." get\:"Returns a list of TRACKIDS mapped to shell-escaped filenames." goto\:"Plays the given TRACKID." max\:"Sets or gets the maximum number of tracks allowed in the tracklist." next\:"Jump to the next track in the tracklist." prev\:"Jump to the previous track in the tracklist." repeat\:"Show/or change repeat status of the tracklist." shuffle\:"Show/or change the current shuffle status of the tracklist." swap\:"Swaps the positions of two tracks." tracks\:"Returns a list of all TRACKIDS in the tracklist." ))' ;; (trim) _arguments \ '1:select beginning' \ '2:select end' ;; (*) ;; esac --c24akeeebkpshzts-- --nc4aiwn63qlfofwq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOs8mWLxNNfbkcA2v/aPFQqvGjgcFAl2+IOcACgkQ/aPFQqvG jgeKlg//TgBonRAZglmWiu4ojCn/bU7VUazCs0UQuPMYjs4OppZShWSmHbTojw/O VD0Z5pGjIrits8fkPqW9Flqz5sUrANwDuL0Sjy395opYKUQ3Oe2PrlxCBDp606G2 w3ImD+ziWNJhFm6fUTiGnvsOdoNwQmx2lGMf4c4+qeCxqsjYVi3GSLCSty3s2pAv Py1F10ket/2J6IlM7zlItl/dnBKpwQWW6JfDzlUahHsniVBah9SIohvbxjUKM5L5 oGMzqviO5IIt8/uxEs1CmRj7PCSy9Q+R6xLatm6aRAkfmCpMCQMmt2T69Rp1n/BM 7uNOyJPF04IyKw97qv53oBWfkD9XuTFztHVSs4VVunNWFgU+LesmgSTypx7qwJfl NMaUGebQ+WoJaCb692wdsW+x/l5mMm4mS4o2zEGUEEa1Mra73LrqrRG0FzsIcNuI oz/WyG+azKVieotdd+shiXuvhJ3VaHQScFlajFqPY5+7Ljuoze2dZD5gDdcBTinS KjMo7+jeyAHt+XpvvI2ayphxUHmpKI+SG4kACgXeQJyoKhdbQxEJjH41vpXLbbPn Cse47kG4wMvC9mDjVmDtl6yYpDPThMO/+I7hJ949+Hfa97zthJR9lyv31cSVJ7/e MnjZpJZl1+AsuUKKul7KZtlbqsz1H7NQ0V9he1P7DLQdxiDhly0= =QPT6 -----END PGP SIGNATURE----- --nc4aiwn63qlfofwq--