mirror of
https://github.com/AdisonCavani/distro-grub-themes.git
synced 2025-06-07 15:32:34 +02:00
28 lines
819 B
C#
28 lines
819 B
C#
using CommandLine;
|
|
using CommandLine.Text;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace DistroGrubThemes
|
|
{
|
|
public class Help
|
|
{
|
|
public static void DisplayHelp<T>(ParserResult<T> result, IEnumerable<Error> errs)
|
|
{
|
|
HelpText helpText = null;
|
|
if (errs.IsVersion())
|
|
helpText = HelpText.AutoBuild(result);
|
|
else
|
|
{
|
|
helpText = HelpText.AutoBuild(result, h =>
|
|
{
|
|
h.AdditionalNewLineAfterOption = false;
|
|
h.Heading = string.Empty;
|
|
h.Copyright = string.Empty;
|
|
return HelpText.DefaultParsingErrorsHandler(result, h);
|
|
}, e => e);
|
|
}
|
|
Console.WriteLine(helpText);
|
|
}
|
|
}
|
|
}
|