I've seen many command line tools that take a "--" argument. For example:
gem install mysql -- —–with-mysql-config=/usr/local/mysql/bin/mysql_config
What does it stand for? Does it have a special meaning?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI've seen many command line tools that take a "--" argument. For example:
gem install mysql -- —–with-mysql-config=/usr/local/mysql/bin/mysql_config
What does it stand for? Does it have a special meaning?
It means the tool should stop treating the dash as an option character. For example, suppose you want to search for a dash character in a file:
grep -- - file
In your example the --
is necessary because the gem tool is calling another tool, which also uses dash-prefixed options.
This is common practice when one program, that takes long options, needs to call another program that also takes long options. It signals the first program to stop parsing options, and pass the rest on, unchanged, to the subprocess that it invokes.