2017-03-06 11:57:19 -08:00
|
|
|
|
using System.IO;
|
|
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
|
|
|
|
using Microsoft.DotNet.Tools.Common;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
|
{
|
|
|
|
|
internal static class CommonOptions
|
|
|
|
|
{
|
|
|
|
|
public static Option HelpOption() =>
|
2017-03-06 20:53:26 -08:00
|
|
|
|
Create.Option(
|
|
|
|
|
"-h|--help",
|
|
|
|
|
"Show help information",
|
|
|
|
|
Accept.NoArguments,
|
|
|
|
|
materialize: o => o.Option.Command().HelpView());
|
2017-03-06 11:57:19 -08:00
|
|
|
|
|
|
|
|
|
public static Option VerbosityOption() =>
|
2017-03-06 20:53:26 -08:00
|
|
|
|
Create.Option(
|
|
|
|
|
"-v|--verbosity",
|
|
|
|
|
"Set the verbosity level of the command. Allowed values are q[uiet],<2C>m[inimal],<2C>n[ormal],<2C>d[etailed], and<6E>diag[nostic]",
|
2017-03-09 07:35:06 -08:00
|
|
|
|
Accept.AnyOneOf(
|
|
|
|
|
"q", "quiet",
|
2017-03-06 20:53:26 -08:00
|
|
|
|
"m", "minimal",
|
|
|
|
|
"n", "normal",
|
|
|
|
|
"d", "detailed")
|
|
|
|
|
.ForwardAs("/verbosity:{0}"));
|
2017-03-06 11:57:19 -08:00
|
|
|
|
|
|
|
|
|
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
|
|
|
|
|
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
|
|
|
|
}
|
|
|
|
|
}
|