From a5c63c90a02665267c11c8bf2c653fd6db8d0107 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 24 Oct 2018 21:02:24 -0700 Subject: Update to command-line parsing re-organization --- .../ExamplePreprocessorExtensionAndCommandLine.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs') diff --git a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs index 8fed7944..eddcf6e4 100644 --- a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace Example.Extension { @@ -23,17 +23,23 @@ namespace Example.Extension { } - public bool TryParseArgument(IParseCommandLine parseCommandLine, string arg) + public bool TryParseArgument(ICommandLineParser parser, string argument) { - if (parseCommandLine.IsSwitch(arg) && arg.Substring(1).Equals("example", StringComparison.OrdinalIgnoreCase)) + if (parser.IsSwitch(argument) && argument.Substring(1).Equals("example", StringComparison.OrdinalIgnoreCase)) { - this.exampleValueFromCommandLine = parseCommandLine.GetNextArgumentOrError(arg); + this.exampleValueFromCommandLine = parser.GetNextArgumentOrError(argument); return true; } return false; } + public bool TryParseCommand(ICommandLineParser parser, out ICommandLineCommand command) + { + command = null; + return false; + } + public void PostParse() { } -- cgit v1.2.3-55-g6feb