zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: update _mozilla
@ 2006-10-11 19:42 arno.
  2006-10-12  2:46 ` Andrey Borzenkov
  0 siblings, 1 reply; 3+ messages in thread
From: arno. @ 2006-10-11 19:42 UTC (permalink / raw)
  To: zsh-workers

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

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
My patch also add option '-inspector' for both 
And options '-profile', '-safe-mode', '-new-window', '-new-tab' and
'-install-global-extension' for Firefox only.

Source for those informations :
http://kb.mozillazine.org/Command_line_arguments

I also updated 'about:' urls according to what is available for mozilla 
1.8 and firefox 1.5

arno.

? _mozilla.patch
Index: Completion/X/Command/_mozilla
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_mozilla,v
retrieving revision 1.7
diff -r1.7 _mozilla
6c6
< local popts="-installer -CreateProfile -P -ProfileWizard -ProfileManager -SelectProfile"
---
> local popts="-installer -CreateProfile -P -ProfileWizard -ProfileManager -SelectProfile -profile"
15d14
<       "($popts)-CreateProfile:profile"
19a19
>       '-edit[start with editor]:URL:_urls' \
25a26,33
>   else
>     mozopts=(
>         "($popts)-profile[start with profile located at the given path]:profile directory:_files -/"
>         "-safe-mode[start without extensions or themes]"
>         "-new-window[load a new window]:URL:_urls"
>         "-new-tab[load a new tab]:URL:_urls"
>         "(-)-install-global-extension[installs an extension globally]:extension file:_files -g '*.xpi'"
>     )
26a35
> 
33a43
>     "($popts)-CreateProfile:profile"\
38d47
<     '-edit[start with editor]:URL:_urls' \
39a49
>     '-inspector[starts with DOM Inspector]:URL:_urls' \
91a102,105
>     local -a aboutmoz
>     if [[ $service != *firefox* ]]; then
>         aboutmoz=(logo about)
>     fi
93,94c107,108
<         compadd "$@" authors blank cache document fonts global hype image-cache \
<             license logo memory-cache mozilla plugins && ret=0
---
>         compadd "$@" blank buildconfig cache credits licence license mozilla \
>             plugins \? buildconfig $aboutmoz && ret=0

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: PATCH: update _mozilla
  2006-10-11 19:42 PATCH: update _mozilla arno.
@ 2006-10-12  2:46 ` Andrey Borzenkov
  2006-10-12  2:55   ` Andrey Borzenkov
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Borzenkov @ 2006-10-12  2:46 UTC (permalink / raw)
  To: zsh-workers; +Cc: arno.

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


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

* Re: PATCH: update _mozilla
  2006-10-12  2:46 ` Andrey Borzenkov
@ 2006-10-12  2:55   ` Andrey Borzenkov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2006-10-12  2:55 UTC (permalink / raw)
  To: zsh-workers; +Cc: arno.

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

On Thursday 12 October 2006 06:46, Andrey Borzenkov wrote:
> in this case you need to use $service

oops sorry I really should stop answering in the morning :(
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFLa6wR6LMutpd94wRAgtGAJ9lbQYgPzgFwpS1kibUns55v0hKXgCgzNoo
lBxbfSLPLma4vfojPoQbJTQ=
=Gevu
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2006-10-12  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-11 19:42 PATCH: update _mozilla arno.
2006-10-12  2:46 ` Andrey Borzenkov
2006-10-12  2:55   ` Andrey Borzenkov

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