-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from 0xced/command-comment
Add the actual command that generated the .cs file in the comments
- Loading branch information
Showing
8 changed files
with
166 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Xunit; | ||
|
||
namespace XmlSchemaClassGenerator.Tests | ||
{ | ||
public class ExtensionsTests | ||
{ | ||
[Theory] | ||
[InlineData(null, null)] | ||
[InlineData("", "")] | ||
[InlineData("MyText", "MyText")] | ||
[InlineData("My Text", "\"My Text\"")] | ||
public void QuoteEmptyOrNull(string input, string expected) | ||
{ | ||
Assert.Equal(expected, input.QuoteIfNeeded()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace XmlSchemaClassGenerator | ||
{ | ||
public class CommandLineArgumentsProvider | ||
{ | ||
public CommandLineArgumentsProvider(string commandLineArguments) | ||
{ | ||
CommandLineArguments = commandLineArguments; | ||
} | ||
|
||
public string CommandLineArguments { get; } | ||
|
||
public static CommandLineArgumentsProvider CreateFromEnvironment() | ||
{ | ||
var args = Environment.GetCommandLineArgs(); | ||
var commandLineArguments = string.Join(" ", args.Take(1).Select(Path.GetFileNameWithoutExtension).Concat(args.Skip(1)).Select(Extensions.QuoteIfNeeded)); | ||
return new CommandLineArgumentsProvider(commandLineArguments); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters