Skip to content

Commit

Permalink
Fix to quote arguments when necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
kojiishi committed Dec 27, 2015
1 parent 8392453 commit 704b784
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
9 changes: 8 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ static void HandleDebugArguments(IEnumerable<string> args) {
return;
}

args = args.Select(arg => File.Exists(arg) ? Path.GetFullPath(arg) : arg);
args = args.Select(arg =>
QuoteIfNeeded(File.Exists(arg) ? Path.GetFullPath(arg) : arg));
config.DebugStartArguments = string.Join(" ", args);
}

static string QuoteIfNeeded(string arg) {
if (!arg.Contains(' '))
return arg;
return string.Concat("\"", arg, "\"");
}
}
}
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,19 @@ This utility controls Visual Studio from command line.

This syntax opens the specified file in Visual Studio.

## Debug Start Program
## Set Start Program to Debug

<pre>vsmcd start <i>path-to-program</i> <i>arguments...</i></pre>

This syntax sets the path of start program of the startup project.
This syntax sets the start program of the startup project.

* File paths are expanded to the full paths.
* Paths are expanded to the full paths.
* If _arguments_ is specified, they are set to the command line arguments.
To set the command line arguments without changing the start program,
please refer to the `arg` command.
* If arguments are omitted, vscmd displays the current settings.

## Debug Arguments
## Set Start Arguments to Debug

<pre>vsmcd arg <i>arguments...</i></pre>

This syntax sets the command line arguments of the startup project.

* File paths are expanded to the full paths.
* If _arguments_ is omitted, vscmd displays the current settings.
* Paths are expanded to the full paths.

0 comments on commit 704b784

Please sign in to comment.