Cannot set config when exec `yarn config set` which key start with "-"
When we set config from yarn cli, it'll show errors if the config key start with -.
For example, yarn config get "--mutex", yarn config set "--mutex" "network"
If using single quote yarn config set '--mutex' "network", the result is still error in .yarnrc.
"'mutex'" network
version
yarn 1.22.5
Expected
success Set "--mutex" to "network".
Actual
error Invalid subcommand. Try "set, get, delete, list, current"
info Visit https://yarnpkg.com/en/docs/cli/config for documentation about this command.
Yarn v1 uses commander for command line argument parsing, and unfortunately this seems like an issue with commander.
Possibly one of:
https://github.com/tj/commander.js/issues/636 https://github.com/tj/commander.js/issues/801 https://github.com/tj/commander.js/issues/289 https://github.com/tj/commander.js/issues/250
You need to separate it with a -- to indicate that you're not trying to use an option
yarn config set -- "--mutex" "network"
yarn config get -- "--mutex"