What do double quotes mean around a domain in `defaults`

defaultsterminal

While experimenting with the defaults command, I issued the following on my terminal:

defaults read com.apple.Safari

In the output I can read the following:

"ShowFavoritesBar-v2" = 1;

Note the double quotes!

Almost all of the other domains don't have the double quotes, whereas this one yes. And, if I'm not mistaken, it was an option I changed through Safari itself, just before issuing the command.

What do double quotes mean around a domain in defaults?

Best Answer

Defaults outputs old-style property lists. - is not a valid key character, so this would be an invalid plist without the quotes. With quotes, the parser understands that the entire string including the hyphen is the key. Defaults adds quotes where otherwise invalid plist keys would be output.