zsh-workers
 help / color / mirror / code / Atom feed
* Contributing with Completions
@ 2007-07-18 13:50 Renato Botelho
  2007-07-19  4:37 ` Peter Stephenson
  0 siblings, 1 reply; 7+ messages in thread
From: Renato Botelho @ 2007-07-18 13:50 UTC (permalink / raw)
  To: zsh-workers

Hello all,

I've started to use zsh 2 days ago on my FreeBSD Desktop, this is a
really great shell.

I've written 2 Completions, and I would like to share it with the
community, how can I send this to be added in the project?

These completions are specific to FreeBSD, is about "csup" and "portsnap".

Thanks
-- 
Renato Botelho


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-18 13:50 Contributing with Completions Renato Botelho
@ 2007-07-19  4:37 ` Peter Stephenson
  2007-07-19 13:01   ` Renato Botelho
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2007-07-19  4:37 UTC (permalink / raw)
  To: Renato Botelho; +Cc: zsh-workers

"Renato Botelho" wrote:
> Hello all,
> 
> I've started to use zsh 2 days ago on my FreeBSD Desktop, this is a
> really great shell.
> 
> I've written 2 Completions, and I would like to share it with the
> community, how can I send this to be added in the project?

Posting completion functions here is fine.

> These completions are specific to FreeBSD, is about "csup" and "portsnap".

We already have a BSD directory in completion, so it can go there.

pws


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-19  4:37 ` Peter Stephenson
@ 2007-07-19 13:01   ` Renato Botelho
  2007-07-20 16:39     ` Peter Stephenson
  2007-07-22 11:34     ` Clint Adams
  0 siblings, 2 replies; 7+ messages in thread
From: Renato Botelho @ 2007-07-19 13:01 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On 7/19/07, Peter Stephenson <pws@csr.com> wrote:
> "Renato Botelho" wrote:
> > Hello all,
> >
> > I've started to use zsh 2 days ago on my FreeBSD Desktop, this is a
> > really great shell.
> >
> > I've written 2 Completions, and I would like to share it with the
> > community, how can I send this to be added in the project?
>
> Posting completion functions here is fine.

Nice,

So, here it is:

_csup -> csup is cvsup rewritten in C, it's on FreeBSD base system, i
don't know if NetBSD or OpenBSD are using it.

_portlint -> Tool for check FreeBSD ports syntax

_portsnap -> Tool for get/update FreeBSD ports tree using snapshots

Comments, suggestions, critics are welcome, like I said, these are my
first lines in zsh since i'm using it for less than a week.

I hope to contribute more.

Thanks

-- 
Renato Botelho

[-- Attachment #2: _portlint --]
[-- Type: application/octet-stream, Size: 742 bytes --]

#compdef portlint

_arguments -s \
    '-a[additional check for scripts/* and pkg-*]' \
    '-A[turn on all additional checks (equivalent to -abcNt)]' \
    '-b[warn $(VARIABLE)]' \
    '-c[committer mode]' \
    '-C[pedantic committer mode (equivalent to -abct)]' \
    '-g[group errors together to avoid duplication (disabled if -v is specified)]' \
    '-h[show summary of command line options]' \
    '-v[verbose mode]' \
    '-t[nit pick about use of spaces]' \
    '-N[writing a new port]' \
    '-V[print the version and exit]' \
    '-M:set make variables to ENV (ex. PORTSDIR=/usr/ports.work):_guard ".#" "environment vars"' \
    '-B:allow # contiguous blank lines:_guard "[0-9]#" "numeric value"' \
    ':port directory:_files -/'

[-- Attachment #3: _csup --]
[-- Type: application/octet-stream, Size: 748 bytes --]

#compdef csup

_arguments -s \
    '-1[disable automatic retries]' \
    '-4[Force usage of IPv4 addresses]' \
    '-6[Force usage of IPv6 addresses]' \
    '-A:local address:_hosts' \
    '-b:base directory:_files -/' \
    '-c:collections directory:_files -/' \
    '-d:maximum number of deleted files:' \
    '-h:server host:_hosts' \
    '-i:file pattern:' \
    '-k[keep temporary copies of failed updates]' \
    '-l:lock file:_files' \
    '-L:verbosity level:(0 1 2)' \
    '-p:port:_ports' \
    '-r:maximum number of retries:' \
    '-s[suppress status checks]' \
    '-v[print version information]' \
    '(-Z)-z[enable compression]' \
    '(-z)-Z[disable compression]' \
    ':csup file:_files' \
    ':destination directory:_files -/'

[-- Attachment #4: _portsnap --]
[-- Type: application/octet-stream, Size: 915 bytes --]

#compdef portsnap

flags=(
  '(cron)fetch[Fetch a compressed snapshot or update existing one]'
  '(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
  '(update)extract[Extract snapshot, replacing existing files and dirs]'
  '(extract)update[Update ports tree to match current snapshot]'
)

_arguments -C -s \
    '-d:Store working files in workdir:_files -/' \
    '-f:Read configuration options from conffile:_files' \
    '-I[Update INDEX only. (update command only)]' \
    '-k:Trust an RSA key with SHA256 hash of KEY:_files' \
    '-l:Merge the specified local describes file into the INDEX:_files' \
    '-p:Location of uncompressed ports tree:_files -/' \
    '-s:Server from which to fetch updates:_hosts' \
    '*:principal:->principal' && ret=0

if [[ $state = principal ]]; then
  _alternative \
    ':file flag:_values -S " " -w "commands" $flags[@]' \
    '*:path:_files -/'
fi

return ret

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-19 13:01   ` Renato Botelho
@ 2007-07-20 16:39     ` Peter Stephenson
  2007-07-20 17:54       ` Renato Botelho
  2007-07-22 11:34     ` Clint Adams
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2007-07-20 16:39 UTC (permalink / raw)
  To: zsh-workers

"Renato Botelho" wrote:
> _csup -> csup is cvsup rewritten in C, it's on FreeBSD base system, i
> don't know if NetBSD or OpenBSD are using it.
> 
> _portlint -> Tool for check FreeBSD ports syntax
> 
> _portsnap -> Tool for get/update FreeBSD ports tree using snapshots

Thanks, added.  I haven't actually tried these out myself but no doubt
someone, somewhere will use them eventually.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-20 16:39     ` Peter Stephenson
@ 2007-07-20 17:54       ` Renato Botelho
  0 siblings, 0 replies; 7+ messages in thread
From: Renato Botelho @ 2007-07-20 17:54 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On 7/20/07, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> "Renato Botelho" wrote:
> > _csup -> csup is cvsup rewritten in C, it's on FreeBSD base system, i
> > don't know if NetBSD or OpenBSD are using it.
> >
> > _portlint -> Tool for check FreeBSD ports syntax
> >
> > _portsnap -> Tool for get/update FreeBSD ports tree using snapshots
>
> Thanks, added.  I haven't actually tried these out myself but no doubt
> someone, somewhere will use them eventually.

Thank you! I'll send here my next Completion works for FreeBSD.

-- 
Renato Botelho


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-19 13:01   ` Renato Botelho
  2007-07-20 16:39     ` Peter Stephenson
@ 2007-07-22 11:34     ` Clint Adams
  2007-07-22 15:34       ` Renato Botelho
  1 sibling, 1 reply; 7+ messages in thread
From: Clint Adams @ 2007-07-22 11:34 UTC (permalink / raw)
  To: Renato Botelho; +Cc: zsh-workers

On Thu, Jul 19, 2007 at 10:01:34AM -0300, Renato Botelho wrote:
> _portsnap -> Tool for get/update FreeBSD ports tree using snapshots
>
> Comments, suggestions, critics are welcome, like I said, these are my
> first lines in zsh since i'm using it for less than a week.

When you use ->state, you should declare the scope of the parameters
context, state, line, opt_args.

Index: Completion/BSD/Command/_portsnap
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/BSD/Command/_portsnap,v
retrieving revision 1.1
diff -u -r1.1 _portsnap
--- Completion/BSD/Command/_portsnap	20 Jul 2007 16:39:15 -0000	1.1
+++ Completion/BSD/Command/_portsnap	22 Jul 2007 11:12:05 -0000
@@ -1,5 +1,8 @@
 #compdef portsnap
 
+local context state line
+typeset -A opt_args
+
 flags=(
   '(cron)fetch[Fetch a compressed snapshot or update existing one]'
   '(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
@@ -17,7 +20,7 @@
     '-s:Server from which to fetch updates:_hosts' \
     '*:principal:->principal' && ret=0
 
-if [[ $state = principal ]]; then
+if [[ $state == principal ]]; then
   _alternative \
     ':file flag:_values -S " " -w "commands" $flags[@]' \
     '*:path:_files -/'


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Contributing with Completions
  2007-07-22 11:34     ` Clint Adams
@ 2007-07-22 15:34       ` Renato Botelho
  0 siblings, 0 replies; 7+ messages in thread
From: Renato Botelho @ 2007-07-22 15:34 UTC (permalink / raw)
  To: zsh-workers

On 7/22/07, Clint Adams <clint@zsh.org> wrote:
> On Thu, Jul 19, 2007 at 10:01:34AM -0300, Renato Botelho wrote:
> > _portsnap -> Tool for get/update FreeBSD ports tree using snapshots
> >
> > Comments, suggestions, critics are welcome, like I said, these are my
> > first lines in zsh since i'm using it for less than a week.
>
> When you use ->state, you should declare the scope of the parameters
> context, state, line, opt_args.
>
> Index: Completion/BSD/Command/_portsnap
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/BSD/Command/_portsnap,v
> retrieving revision 1.1
> diff -u -r1.1 _portsnap
> --- Completion/BSD/Command/_portsnap    20 Jul 2007 16:39:15 -0000      1.1
> +++ Completion/BSD/Command/_portsnap    22 Jul 2007 11:12:05 -0000
> @@ -1,5 +1,8 @@
>  #compdef portsnap
>
> +local context state line
> +typeset -A opt_args
> +
>  flags=(
>    '(cron)fetch[Fetch a compressed snapshot or update existing one]'
>    '(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
> @@ -17,7 +20,7 @@
>      '-s:Server from which to fetch updates:_hosts' \
>      '*:principal:->principal' && ret=0
>
> -if [[ $state = principal ]]; then
> +if [[ $state == principal ]]; then
>    _alternative \
>      ':file flag:_values -S " " -w "commands" $flags[@]' \
>      '*:path:_files -/'

Thanks

-- 
Renato Botelho


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-22 15:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 13:50 Contributing with Completions Renato Botelho
2007-07-19  4:37 ` Peter Stephenson
2007-07-19 13:01   ` Renato Botelho
2007-07-20 16:39     ` Peter Stephenson
2007-07-20 17:54       ` Renato Botelho
2007-07-22 11:34     ` Clint Adams
2007-07-22 15:34       ` Renato Botelho

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).