• 命令行选项


    命令行选项

    命令行选项用于为 Mozilla 应用程序指定各种启动选项。例如,您可以使用命令行配置选项来绕过配置档管理器并打开一个特定的配置档(如果您有多个配置档)。您也可以控制 Mozilla 应用程序如何打开,初始打开哪个组件以及当组件打开时要做什么。这个页面描述常用的选项和如何使用它们。

    语法规则

    首先,让我们描述一下适用于所有选项的语法规则。

    • 包含空格的命令参数必须以引号括起;例如 "Joel User"。
    • 命令操作是不区分大小写的。
    • 命令参数,除了配置档名称外都是不区分大小写的。
    • 空格( )用于间隔多个命令和参数。
    • 每条消息选项都遵循语法 字段=,例如:
      • to=foo@nowhere.net
      • subject=cool page
      • attachment=www.mozilla.org
      • attachment='file:///c:/test.txt'
      • body=check this page
    • 多个消息选项用逗号(,)间隔,例如: "to=foo@nowhere.net,subject=cool page"。逗号分隔符一定不能尾随或前缀空格( )。要指派多个值给一个字段,使用单引号(')闭合值,例如: "to='foo@nowhere.net,foo@foo.de',subject=cool page" 

    使用命令行选项

    命令行选项在启动应用程序的命令后输入。某些选项选项有参数。它们在命令行选项后输入。某些选项有缩写替代。例如,命令行选项 "-editor" 可以缩写为 "-edit"。(其中可用的缩写将会在下面的文本中阐述) 在某些情况下,选项参数必须用引号括起。(这会在以下的选项描述中注明。) 可以指定多个命令行选项。通常,语法如下:

    应用程序 -选项 -选项 "参数" -选项 参数

    示例

    下列示例显示 "-ProfileManager" 命令的使用,它将会在启动 Firefox 或 Thunderbird 前打开配置档管理器:

    Windows

    从 Windows 开始菜单中选择运行,输入:

    firefox -ProfileManager
    Mac OS X

    转到 Applications > Utilities,打开终端并输入:

    cd /Applications/Firefox.app/Contents/MacOS
    ./firefox -ProfileManager
    Linux

    打开终端并输入:

    cd Thunderbird 安装目录
    ./thunderbird -ProfileManager

    以上示例调用 "-ProfileManager" 命令行选项用于 Mozilla 的 Thunderbird 邮件客户端。

    用户配置档

    -CreateProfile profile_name

    创建一个名为profile_name 的配置档,而不启动程序。profile_name 一定不能包含空格( )。

    firefox -CreateProfile JoelUser

    -CreateProfile "profile_name profile_dir"

    在目录 profile_dir 中创建一个名为 profile_name 的配置档而不启动应用程序。注意 profile_name  profile_dir 必须括在一起。(在 SeaMonkey1.x 中未有)

    注: profile_dir 必须存在而且您必须还未有称为 profile_name 的配置档。

    firefox -CreateProfile "JoelUser c:internetmoz-profile"

    -ProfileManager

    使用配置档管理器启动。

    -SelectProfile

    使用配置档选择对话框启动。仅用于 SeaMonkey1.x

    -ProfileWizard

    使用配置档向导启动。仅用于 SeaMonkey1.x

    -P "profile_name"

    绕过配置档管理器并使用名为profile_name 的配置档启动。对于处理多个配置档很有用。注意profile_name 是区分大小写的。如果您未指定一个配置档名称,那么就会打开配置档管理器。在 L:inux 上,您必须使用大写字母 P,因为小写调用 Purify 模式(内存和泄露探测)。其它平台大小写都接受。

    firefox -P "Joel User"

    -profile "profile_path"

    使用给出路径的配置档启动。仅用于 FirefoxThunderbird  SeaMonkey2.x

    "profile_path" 可以是一个绝对路径("/path/to/profile") 或一个相对路径("path/to/profile").

    在 Mac OS X 上,从 Firefox 4.0 和以上,由于 regression 的原因,不在支持给出相对路径,查看bug 673955.

    -no-remote

    允许同一事件打开多个应用程序副本。(在 SeaMonkey1.x 中无效,它仅支持 MOZ_NO_REMOTE=1)。

    firefox -no-remote -P "另一个配置档"

    -migration

    使用导入向导启动。(SeaMonkey1.x 中无效)

    -installer

    使用 Netscape 4.x 迁移窗口启动。仅用于 SeaMonkey1.x

    -resetPref preference

    重置指定的首选项(逗号间隔)为默认值。仅用于 SeaMonkey1.x

    seamonkey -resetPref browser.startup.homepage

    -override /path/to/override.ini

    加载指定的 override.ini 文件以覆盖 application.ini (browser/app/application.ini)中的配置。通过加载下列 override.ini 可以抑制在启动时的迁移向导。仅用于 Firefox

    [XRE]
    EnableProfileMigrator=0

    浏览器

    -browser

    使用 browser(浏览器)组件启动。仅用于 Firefox  SeaMonkey

    -url URL

    根据浏览器选项,在新标签页或窗口中打开 URL-url 可以省略。仅用于 Firefox  SeaMonkey。注: 当打开多个 URLs 时,Firefox 总是把它们打开为一个新窗口中的选项页。

    firefox www.mozilla.com

    -private

    以私密浏览模式打开 Firefox,而不考虑当前的用户首选项。仅用于 Firefox 3.6 和以后版本。

    -new-tab URL

    在新标签页中打开 URL。仅用于 Firefox  SeaMonkey2.x

    -new-window URL

    在新窗口中打开 URL。仅用于 Firefox  SeaMonkey2.x

    -search term

    使用您的默认搜索引擎搜索 term。仅用于 Firefox  SeaMonkey2.x 及以后的版本。

    -preferences

    打开选项/首选项窗口。仅用于 Firefox  SeaMonkey2.x

    -setDefaultBrowser

    设置应用程序为默认的浏览器。仅用于 Firefox

    邮件/新闻

    -mail

    使用邮件客户端启动。仅用于 Thunderbird  SeaMonkey

    -mail mailto_URL

    为给出的 mailto_URL 启动撰写消息的窗口。仅用于 Thunderbird

    thunderbird -mail mailto:me@isp.net?subject=hi

    -news news_URL

    使用新客户端启动。如果给出了 news_URL (可选),则打开指定的新闻组。仅用于 Thunderbird  SeaMonkey

    thunderbird -news news://server/group

    -compose message_options

    使用邮件撰写器启动。查看语法规则。仅用于 Thunderbird  SeaMonkey

    thunderbird -compose "to=foo@nowhere.net"

    -addressbook

    使用地址簿启动。仅用于 Thunderbird  SeaMonkey

    -options

    打开选项/首选项窗口。仅用于 Thunderbird

    -offline

    以离线模式启动。仅用于 Thunderbird  SeaMonkey

    -setDefaultMail

    设置应用程序为默认的邮件客户端。仅用于 Thunderbird

    日历

    -calendar

    使用日历客户端启动。仅用于 Sunbird

    -subscribe URL  -url URL

    订阅到给出的 URL。仅用于 Sunbird

    -showdate 日期

    显示给出的日期的您的计划安排。仅用于 Sunbird

    sunbird -showdate 08/04/2008

    其它组件

    -editor URL  -edit URL

    为给出的 URL 使用编辑器(撰写器)启动(其中 URL 是可选的)。仅用于 SeaMonkey

    seamonkey -edit www.mozilla.org

    -jsconsole

    使用错误控制台启动应用程序.

    -inspector URL

    使用 DOM Inspector 启动(如果已安装的话),并观察给出的 URL (其中 URL 是可选的)。

    -venkman

    使用 JavaScript 调试器 Venkman 启动(如果已安装的话)。

    -chat

    使用 IRC 客户端 ChatZilla 启动(如果已安装的话)。

    XULRunner

    -app /path/to/application.ini

    启动一个新进程运行在指定路径 path/to 处的 XULRunner 应用程序。仅用于 Firefox 版本 3 和以上。

    Chrome

    -chrome chrome_URL

    加载指定的 chrome。

    firefox -chrome chrome://inspector/content

    -register chrome_URL

    注册指定的 chrome,而不启动应用程序。

    扩展附件

    Gecko 1.9.2 note
    -install-global-extension 和 -install-global-theme 已经从 Gecko 1.9.2 和以上的版本移除。

    -install-global-extension /path/to/extension

    安装扩展到应用程序目录。参数是扩展的路径。您必须有管理权限。(在 SeaMonkey1.x 中无效,但是某些扩展已经把这个作为一个安装时的选项)。

    -install-global-theme /path/to/theme

    和上面类似,但是只用于主题。您必须有管理权限。(在 SeaMonkey1.x 中无效,但是某些扩展已经把这个作为一个安装时的选项)。

    从 Firefox 2.0.0.7 开始,-install-global-extension  -install-global-theme 命令行参数选项的使用被限制为只允许安装在本地磁盘或映射的驱动器上的附加组件。从网络共享直接安装将不再成功。

    -safe-mode

    禁用所有的扩展启动应用程序,仅用于启动。(扩展不会加载,但是不会在扩展管理器数据源中永久禁用)。(在 SeaMonkey1.x 中无效)

    语种

    -UILocale locale

     locale 资源作为用户界面的语种。

    firefox -UILocale en-US

    启动

    -turbo

    Launch application in Quick Launch mode. SeaMonkey1.x only.

    -nosplash or -quiet

    Suppresses display of the splash screen. To show splash screen, use the -splash command. Note the splash screen is disabled by default on some systems.SeaMonkey1.x only.

    远程控制

    -remote 远程命令

    在一个已经运行的应用程序进程中执行远程命令(查看远程控制)。注: Unix/Linux 仅适用于 SeaMonkey1.x

    firefox -remote "openURL(www.mozilla.org, new-tab)"

    其它

    -silent

    不打开默认窗口。对于那些打开它们自己窗口但是未防止默认窗口打开的那些命令行参数很有用。仅适用于 FirefoxThunderbird3.x  SeaMonkey2.x

    -console

    使用一个调试控制台启动应用程序。注:仅适用于 Windows。

    -h  -help  -?

    显示所有可用的命令行参数的列表。注意,在 Windows 上仅对调试构建版本(bug 355889)有效。这个选项仅在命令行控制台中可用。

    -v  -version

    打印应用程序版本。注意,在 Windows 上仅对调试构建版本(bug 355889)有效。

    -osint

    告诉应用程序它是被 OS SHell 启动的。这个不应该指定,除非调用者在启动应用程序时,提供了 OS  Shell 的所有功能。(bug 384384).

    -requestPending

    Tells the application that there will be a Windows DDE request to open the same url specified on the command line. This should not be specified unless the caller provides all of the functionality provided by the OS shell when launching the application (bug 354005).

    X11 options

    These options are only available for an application build for and running atop the X11/X.org display and window system to be found on Linux and other Unices.

    --display=DISPLAY

    设置要使用的 X display

    --sync

    使 X 调用同步

    --g-fatal-warnings

    使所有警告视为严重

    其它需要编写文档的选项

    • -print-xpcom-dir
    • -print-xpcom-dirlist
    • -kill
    • -killAll
    • -f
    • -ftimeout
    • -fwait
    • -unsetDefaultMail
    • -foreground
    • GTK options

    参考





  • 相关阅读:
    R语言导入scv文件乱码问题及解决
    水论文而已,科研就交给恐龙吧
    R语言实现单因素方差分析带字母的显著性标记
    记录新的学习
    如果你的校园网连不上很有可能是因为IE代理服务出错导致无法上网
    git 补充
    git
    学习linux的菜鸟 shell脚本中的循环
    学习linux的菜鸟 shell脚本中的逻辑判断
    学习linux的菜鸟 shell脚本中的dat,计算器,内置变量的用法
  • 原文地址:https://www.cnblogs.com/Full--Stack/p/8042018.html
Copyright © 2020-2023  润新知