Selenium ChromeOptions中的双破折号(-)表示什么 [英] What does double dash (--) implies in Selenium ChromeOptions

查看:111
本文介绍了Selenium ChromeOptions中的双破折号(-)表示什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java中使用了硒,并且在其中使用了一些chrome选项.但是我在不同来源中看到了chrome选项的不同用法.我的意思是有些人在选项前使用双破折号,而有些人则没有(例如 disable-dev-shm-usage -disable-dev-shm-usage ).两种用法之间有什么区别吗?

I am using selenium with java and I am using some chrome options with it. But I see different usages of chrome options in different sources. I mean some folks using double dash before the option and some do not (like disable-dev-shm-usage and --disable-dev-shm-usage). Are there any differences between the two usages?

推荐答案

按照

Unix传统鼓励使用命令行开关来控制程序,以便可以从脚本中指定选项.有区分命令行选项和普通命令行的三种约定参数如下:

Unix tradition encourages the use of command-line switches to control programs, so that options can be specified from scripts. There are three conventions to distinguish command-line options from ordinary arguments as follows:

  • 原始的Unix风格
  • GNU风格
  • X工具包样式

GNU样式使用选项关键字(而不是关键字字母)前面有两个连字符.几年后,当一些精巧的GNU实用程序开始用完单个字母选项键(这是症状的补丁,而不是解决方法潜在疾病).它仍然很受欢迎,因为GNU选项比旧样式的字母汤更容易阅读.GNU风格选项不能组合在一起而不分隔空格.

The GNU style uses option keywords (rather than keyword letters) preceded by two hyphens. It evolved years later when some of the rather elaborate GNU utilities began to run out of single-letter option keys (this constituted a patch for the symptom, not a cure for the underlying disease). It remains popular because GNU options are easier to read than the alphabet soup of older styles. GNU-style options cannot be ganged together without separating whitespace.

选择了GNU双连字符选项首选项,以便可以在同一命令行上明确混合使用传统的单字母选项和GNU样式的关键字选项.

The GNU double-hyphen option leader was chosen so that traditional single-letter options and GNU-style keyword options could be unambiguously mixed on the same command line.

这篇关于Selenium ChromeOptions中的双破折号(-)表示什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆