问题
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?
回答1:
As per Command-Line Options:
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:
- The original Unix style
- The GNU style
- The X toolkit style
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.
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.
来源:https://stackoverflow.com/questions/60039687/what-does-double-dash-implies-in-selenium-chromeoptions