mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 09:09:47 +02:00
Spaces allowed in batch command parameter values now
PROVIDED you use single or double quotes around the string.
This commit is contained in:
parent
f9fb4b3b7d
commit
f8be26a9b8
@ -308,6 +308,11 @@ bool ShuttleCli::ExchangeWithMaster(const wxString & Name)
|
||||
terminator = wxT('"');
|
||||
j++;
|
||||
}
|
||||
else if(mParams.GetChar(j) == wxT('\'')) // or by single quotes.
|
||||
{
|
||||
terminator = wxT('\'');
|
||||
j++;
|
||||
}
|
||||
i=j;
|
||||
while( j<(int)mParams.Length() && mParams.GetChar(j) != terminator )
|
||||
j++;
|
||||
|
@ -150,9 +150,23 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
|
||||
Failure(wxT("Unrecognized parameter: '") + paramName + wxT("'"));
|
||||
return;
|
||||
}
|
||||
// Handling of quoted strings is quite limitted.
|
||||
// You start and end with a " or a '.
|
||||
// There is no escaping in the string.
|
||||
cmdParams = cmdParams.Mid(splitAt+1);
|
||||
splitAt = cmdParams.Find(wxT(' '));
|
||||
if (splitAt < 0)
|
||||
if( cmdParams.IsEmpty() )
|
||||
splitAt =-1;
|
||||
else if( cmdParams[0] == '\"' ){
|
||||
cmdParams = cmdParams.Mid(1);
|
||||
splitAt = cmdParams.Find(wxT('\"'))+1;
|
||||
}
|
||||
else if( cmdParams[0] == '\'' ){
|
||||
cmdParams = cmdParams.Mid(1);
|
||||
splitAt = cmdParams.Find(wxT('\''))+1;
|
||||
}
|
||||
else
|
||||
splitAt = cmdParams.Find(wxT(' '))+1;
|
||||
if (splitAt < 1)
|
||||
{
|
||||
splitAt = cmdParams.Len();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user