Complete the refactor and test improvements

This commit is contained in:
Justin Goshi 2016-12-16 10:23:26 -08:00
parent 82f5278d8a
commit ae1e183e41
14 changed files with 188 additions and 202 deletions

View file

@ -2,11 +2,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Tools;
namespace Microsoft.DotNet.Cli.CommandLine
{
internal class CommandParsingException : Exception
{
private bool _isRequireSubCommandMissing;
public CommandParsingException(
CommandLineApplication command,
string message,
@ -14,10 +17,19 @@ namespace Microsoft.DotNet.Cli.CommandLine
: base(message)
{
Command = command;
IsRequireSubCommandMissing = isRequireSubCommandMissing;
_isRequireSubCommandMissing = isRequireSubCommandMissing;
}
public CommandLineApplication Command { get; }
public bool IsRequireSubCommandMissing { get; }
public override string Message
{
get
{
return _isRequireSubCommandMissing
? CommonLocalizableStrings.RequiredCommandNotPassed
: base.Message;
}
}
}
}