How to execute CLI command when white space is included in value for group parameter
This article helps to execute the CLI commands when the value passed in the parameter is having white spaces.
Instructions
You can escape the white space in the group parameter while passing the input values in two possible scenarios, based on the Operating System you are using (macOS and Windows).
Find the details below based on the Operating System:
On macOS:
While executing the command using the run parameters on macOS, sometimes it throws an error. That is because the white spaces are included in the values.
In this article, a group name my local group is used. It throws an error as shown below, if you pass the value as --group "my local group":
Parameter error: Unexpected argument: local
To run the command successfully, escape the white spaces using "\""my local group\"" as shown below:--action runFromCsv --file "spaces.csv" --common "--action addPermissions --permissions "viewspace" --group "\""my local group\""
On Windows:
If the CLI command is used as --group "my local group" without escaping the white spaces, it throws an error:
Parameter error: Unexpected argument: local
To run the command successfully, use the escape characters like this - ""my local group"" as shown below:--action runFromCsv --file "spaces.csv" --common "--action addPermissions --permissions "viewspace" --group ""my local group"""
It is recommended to test this scenario in a non-production environment or run the action with the --simulate parameter, to verify the behavior before deploying on a production environment.