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

Re: PATCH: update _mozilla



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 11 October 2006 23:42, arno. wrote:
> Hi, there is a _mozilla completion that can also be used for firefox
> A few options are set differently for firefox and mozilla.
> Option '-edit' is available for both but works only in mozilla
> Option '-CreateProfile' is available for mozilla only but works for both


in this case you need to use $service in completion function to distinguish 
between the two and use correct options. Usually it  is done like

common_opts=(optspec optspec2 ...)
case $service in
  cmd1 )
    _arguments $common_opts cmd1_optsec1 cmd1_optspec2 ...
  ;;
  cmd2 )
    _arguments $common_opts cmd2_optspec1 cmd2_optspec2 ...
  ;;
  ...
esac

completion system sets $service to the name of command for which we complete.
Then just stick firefox in #compdef line.

> diff -r1.7 _mozilla
> 6c6

please send a unified diff in future.

thank you

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFLayVR6LMutpd94wRAqiPAJ9mK9qU+X0inoqJ64pcAkgnWDtCkgCfXuvu
ZrPsoQzTDqWnFWcCoxZBYyI=
=VJrL
-----END PGP SIGNATURE-----



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