-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: forward build command args to default command (#8689)
- Loading branch information
Showing
5 changed files
with
58 additions
and
44 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
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,37 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Xunit; | ||
|
||
namespace Microsoft.DocAsCode.Tests; | ||
|
||
public static class CommandLineTest | ||
{ | ||
[Fact] | ||
public static void PrintsVersion() | ||
{ | ||
Assert.Equal(0, Program.Main(new[] { "-v" })); | ||
Assert.Equal(0, Program.Main(new[] { "--version" })); | ||
} | ||
|
||
[Fact] | ||
public static void PrintsHelp() | ||
{ | ||
Assert.Equal(0, Program.Main(new[] { "-h" })); | ||
Assert.Equal(0, Program.Main(new[] { "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "build", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "serve", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "metadata", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "pdf", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "init", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "download", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "merge", "--help" })); | ||
Assert.Equal(0, Program.Main(new[] { "template", "--help" })); | ||
} | ||
|
||
[Fact] | ||
public static void FailForUnknownArgs() | ||
{ | ||
Assert.Equal(-1, Program.Main(new[] { "--unknown" })); | ||
} | ||
} |