Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Chapter07.Tests/Listing07.32.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void ParseHelpCommand(string command)
{
command = item;
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
"Command Help...", () => Program.Main(command));
"Command Help...", () => Program.Main(new[] { command }));
}
}

Expand All @@ -31,7 +31,7 @@ public void ParseCatCommand(string command, string fileName)
{
command = $"{item}";
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
$"Catalog '{fileName}'...", () => Program.Main(command, fileName));
$"Catalog '{fileName}'...", () => Program.Main(new[] { command, fileName }));
}
}

Expand All @@ -44,7 +44,7 @@ public void ParseCopyCommand(string command, string sourceFile, string targetFil
{
command = $"{item}";
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
$"Copy '{sourceFile}' '{targetFile}'...", () => Program.Main(command, sourceFile, targetFile));
$"Copy '{sourceFile}' '{targetFile}'...", () => Program.Main(new[] { command, sourceFile, targetFile }));
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Chapter07/Listing07.32.ListPatternMatching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter07.Listing07_32;
public class Program
{
#region INCLUDE
public static void Main(params string[] args)
public static void Main(string[] args)
{
// For simplicitly, commands are assumed
// For simplicity, options are assumed
// to all be lower case.

// The first argument is the command and is
// The first argument is the option and is
// identified by a '/', '-', or '--' prefix.

switch (args)
{
case ["--help" or ['/' or '-', 'h' or '?']]:
// e.g. /?, -?, /h, -h, --help
// e.g. --help, /h, -h, /?, -?
DisplayHelp();
break;
case [ ['/' or '-', char command], ..]:
Expand Down