4using System.Collections.Generic;
5using System.Globalization;
7using System.Reflection;
10using FluentAssertions;
30 string.Empty.Should().BeEquivalentTo(
new HelpText().ToString());
42 sut.AddNewLineBetweenHelpSections = newlineBetweenSections;
43 sut.AddPreOptionsLine(
"pre-options line 1")
44 .AddPreOptionsLine(
"pre-options line 2")
45 .AddPostOptionsLine(
"post-options line 1")
46 .AddPostOptionsLine(
"post-options line 2");
49 var expected =
new List<string>()
52 "Copyright (C) 2005 - 2013 Author",
55 "post-options line 1",
59 if (newlineBetweenSections)
61 expected.Insert(2,
"");
62 expected.Insert(5,
"");
65 var lines = sut.ToString().ToLines();
66 lines.Should().StartWith(expected);
76 var sut =
new HelpText { AddDashesToOption =
true, AddNewLineBetweenHelpSections = newlineBetweenSections }
87 "--stringvalue Define a string value here.",
88 "-s, --shortandlong Example with both short and long name.",
89 "-i Define a int sequence here.",
90 "-x Define a boolean or switch value here.",
91 "--help Display this help screen.",
92 "--version Display version information.",
93 "value pos. 0 Define a long value here.",
98 var lines = sut.
ToString().ToLines().TrimStringArray();
99 lines.Should().StartWith(expected);
107 var sut =
new HelpText { AddDashesToOption =
true, AddEnumValuesToHelpText =
true, MaximumDisplayWidth = 80 }
114 var lines = sut.
ToString().ToNotEmptyLines().TrimStringArray();
115 lines[0].Should().BeEquivalentTo(
"pre-options");
116 lines[1].Should().BeEquivalentTo(
"--stringvalue Define a string value here.");
117 lines[2].Should().BeEquivalentTo(
"--shape Define a enum value here. Valid values: Circle, Square,");
118 lines[3].Should().BeEquivalentTo(
"Triangle");
119 lines[4].Should().BeEquivalentTo(
"--help Display this help screen.");
120 lines[5].Should().BeEquivalentTo(
"--version Display version information.");
121 lines[6].Should().BeEquivalentTo(
"post-options");
130 var sut =
new HelpText { AddDashesToOption =
true }
137 var lines = sut.
ToString().ToNotEmptyLines().TrimStringArray();
138 lines[0].Should().BeEquivalentTo(
"pre-options");
139 lines[1].Should().BeEquivalentTo(
"--stringvalue Define a string value here.");
140 lines[2].Should().BeEquivalentTo(
"--shape Define a enum value here.");
141 lines[3].Should().BeEquivalentTo(
"--help Display this help screen.");
142 lines[4].Should().BeEquivalentTo(
"--version Display version information.");
143 lines[5].Should().BeEquivalentTo(
"post-options");
153 new HelpText(
"Meta Value.").AddOptions(
157 var lines = sut.
ToString().ToNotEmptyLines().TrimStringArray();
159 lines[2].Should().BeEquivalentTo(
"i FILE, input-file=FILE Required. Specify input FILE to be processed.");
169 sut.MaximumDisplayWidth = 40;
173 Enumerable.Empty<
Error>()));
176 var lines = sut.ToString().Split(
new[] { Environment.NewLine }, StringSplitOptions.None);
177 lines[2].Should().BeEquivalentTo(
" v, verbose This is the description");
179 lines[3].Should().BeEquivalentTo(
" of the verbosity to test");
180 lines[4].Should().BeEquivalentTo(
" out the wrapping");
181 lines[5].Should().BeEquivalentTo(
" capabilities of the Help");
182 lines[6].Should().BeEquivalentTo(
" Text.");
195 Enumerable.Empty<
Error>()));
198 var lines = sut.
ToString().Split(
new[] { Environment.NewLine }, StringSplitOptions.None);
199 lines[2].Should().BeEquivalentTo(
" v, verbose This is the description of the verbosity to test out the wrapping capabilities of");
201 lines[3].Should().BeEquivalentTo(
" the Help Text.");
211 sut.MaximumDisplayWidth = 80;
215 Enumerable.Empty<
Error>()));
218 var lines = sut.ToString().Split(
new[] { Environment.NewLine }, StringSplitOptions.None);
219 lines[2].Should().BeEquivalentTo(
" v, verbose This is the description of the verbosity to test out the");
221 lines[3].Should().BeEquivalentTo(
" wrapping capabilities of the Help Text.");
231 sut.MaximumDisplayWidth = 40;
235 Enumerable.Empty<
Error>()));
238 var lines = sut.ToString().ToNotEmptyLines();
239 lines[1].Should().BeEquivalentTo(
" v, verbose Before");
240 lines[2].Should().BeEquivalentTo(
" 012345678901234567890123");
241 lines[3].Should().BeEquivalentTo(
" After");
242 lines[4].Should().BeEquivalentTo(
" input-file Before");
243 lines[5].Should().BeEquivalentTo(
" 012345678901234567890123");
244 lines[6].Should().BeEquivalentTo(
" 456789 After");
253 var sut =
new HelpText(
"Heading Info.");
254 sut.MaximumDisplayWidth = 40;
255 sut.AddPreOptionsLine(
"Before 0123456789012345678901234567890123456789012 After")
257 .AddPostOptionsLine(
"Before 0123456789012345678901234567890123456789 After");
260 var lines = sut.ToString().ToNotEmptyLines();
261 lines[1].Should().BeEquivalentTo(
"Before");
262 lines[2].Should().BeEquivalentTo(
"0123456789012345678901234567890123456789");
263 lines[3].Should().BeEquivalentTo(
"012 After");
264 lines[lines.Length - 3].Should().BeEquivalentTo(
"Before");
265 lines[lines.Length - 2].Should().BeEquivalentTo(
"0123456789012345678901234567890123456789");
266 lines[lines.Length - 1].Should().BeEquivalentTo(
"After");
275 var optionsInGroup =
new List<NameInfo>
295 Func<Error, string> fakeRenderer = err =>
305 case ErrorType.MissingRequiredOptionError:
310 return "ERR no-verb-selected";
316 return "ERR " + groupErr.Group +
": " +
string.Join(
"---", groupErr.Names.Select(n => n.NameText));
319 throw new InvalidOperationException();
322 Func<IEnumerable<MutuallyExclusiveSetError>,
string> fakeMutExclRenderer =
326 var errorsText =
HelpText.RenderParsingErrorsText(fakeResult, fakeRenderer, fakeMutExclRenderer, 2);
329 var lines = errorsText.ToNotEmptyLines();
330 lines[0].Should().BeEquivalentTo(
" ERR badtoken");
331 lines[1].Should().BeEquivalentTo(
" ERR x, switch");
332 lines[2].Should().BeEquivalentTo(
" ERR unknown");
333 lines[3].Should().BeEquivalentTo(
" ERR missing");
334 lines[4].Should().BeEquivalentTo(
" ERR s, sequence");
335 lines[5].Should().BeEquivalentTo(
" ERR no-verb-selected");
336 lines[6].Should().BeEquivalentTo(
" ERR badverb");
337 lines[7].Should().BeEquivalentTo(
" ERR bad-option-group: t, testOption1---c, testOption2");
354 var helpText =
HelpText.AutoBuild(fakeResult);
357 var lines = helpText.ToString().ToLines().TrimStringArray();
360 lines[2].Should().BeEmpty();
361 lines[3].Should().BeEquivalentTo(
"ERROR(S):");
362 lines[4].Should().BeEquivalentTo(
"Token 'badtoken' is not recognized.");
363 lines[5].Should().BeEquivalentTo(
"A sequence option 'i' is defined with fewer or more items than required.");
364 lines[6].Should().BeEmpty();
365 lines[7].Should().BeEquivalentTo(
"--stringvalue Define a string value here.");
366 lines[8].Should().BeEmpty();
367 lines[9].Should().BeEquivalentTo(
"-s, --shortandlong Example with both short and long name.");
368 lines[10].Should().BeEmpty();
369 lines[11].Should().BeEquivalentTo(
"-i Define a int sequence here.");
370 lines[12].Should().BeEmpty();
371 lines[13].Should().BeEquivalentTo(
"-x Define a boolean or switch value here.");
372 lines[14].Should().BeEmpty();
373 lines[15].Should().BeEquivalentTo(
"--help Display this help screen.");
389 var helpText =
HelpText.AutoBuild(fakeResult);
392 var lines = helpText.ToString().ToLines().TrimStringArray();
396 lines[2].Should().BeEmpty();
397 lines[3].Should().BeEquivalentTo(
"-p, --patch Use the interactive patch selection interface to chose which");
398 lines[4].Should().BeEquivalentTo(
"changes to commit.");
399 lines[5].Should().BeEmpty();
400 lines[6].Should().BeEquivalentTo(
"--amend Used to amend the tip of the current branch.");
401 lines[7].Should().BeEmpty();
402 lines[8].Should().BeEquivalentTo(
"-m, --message Use the given message as the commit message.");
403 lines[9].Should().BeEmpty();
404 lines[10].Should().BeEquivalentTo(
"--help Display this help screen.");
420 var helpText =
HelpText.AutoBuild(fakeResult, maxDisplayWidth: 100);
423 var lines = helpText.ToString().ToNotEmptyLines().TrimStringArray();
426 lines[2].Should().BeEquivalentTo(
"-p, --patch Use the interactive patch selection interface to chose which changes to commit.");
427 lines[3].Should().BeEquivalentTo(
"--amend Used to amend the tip of the current branch.");
428 lines[4].Should().BeEquivalentTo(
"-m, --message Use the given message as the commit message.");
429 lines[5].Should().BeEquivalentTo(
"--help Display this help screen.");
437 var verbTypes = Enumerable.Empty<Type>().Concat(
445 var helpText =
HelpText.AutoBuild(fakeResult);
448 var lines = helpText.ToString().ToNotEmptyLines().TrimStringArray();
452 lines[2].Should().BeEquivalentTo(
"add Add file contents to the index.");
453 lines[3].Should().BeEquivalentTo(
"commit Record changes to the repository.");
454 lines[4].Should().BeEquivalentTo(
"clone Clone a repository into a new directory.");
455 lines[5].Should().BeEquivalentTo(
"help Display more information on a specific command.");
456 lines[6].Should().BeEquivalentTo(
"version Display version information.");
465 var sut =
new HelpText { AddDashesToOption =
true, AdditionalNewLineAfterOption =
false }
472 var lines = sut.
ToString().ToLines().TrimStringArray();
473 lines[0].Should().BeEmpty();
474 lines[1].Should().BeEquivalentTo(
"pre-options");
475 lines[2].Should().BeEmpty();
476 lines[3].Should().BeEquivalentTo(
"--stringvalue=STR Define a string value here.");
477 lines[4].Should().BeEquivalentTo(
"-i INTSEQ Define a int sequence here.");
478 lines[5].Should().BeEquivalentTo(
"-x Define a boolean or switch value here.");
479 lines[6].Should().BeEquivalentTo(
"--help Display this help screen.");
480 lines[7].Should().BeEquivalentTo(
"--version Display version information.");
481 lines[8].Should().BeEquivalentTo(
"number (pos. 0) NUM Define a long value here.");
482 lines[9].Should().BeEquivalentTo(
"paintcolor (pos. 1) COLOR Define a color value here.");
483 lines[10].Should().BeEmpty();
484 lines[11].Should().BeEquivalentTo(
"post-options", lines[11]);
497 var text =
HelpText.RenderUsageText(result);
500 var lines = text.ToNotEmptyLines();
503 lines[0].Should().BeEquivalentTo(
"Normal scenario:");
504 lines[1].Should().BeEquivalentTo(
" mono testapp.exe --input file.bin --output out.bin");
505 lines[2].Should().BeEquivalentTo(
"Logging warnings:");
506 lines[3].Should().BeEquivalentTo(
" mono testapp.exe -w --input file.bin");
507 lines[4].Should().BeEquivalentTo(
"Logging errors:");
508 lines[5].Should().BeEquivalentTo(
" mono testapp.exe -e --input file.bin");
509 lines[6].Should().BeEquivalentTo(
" mono testapp.exe --errs --input=file.bin");
510 lines[7].Should().BeEquivalentTo(
"List:");
511 lines[8].Should().BeEquivalentTo(
" mono testapp.exe -l 1,2");
512 lines[9].Should().BeEquivalentTo(
"Value:");
513 lines[10].Should().BeEquivalentTo(
" mono testapp.exe value");
530 var helpText =
HelpText.AutoBuild(fakeResult,
533 h.AddNewLineBetweenHelpSections = newlineBetweenSections;
534 return HelpText.DefaultParsingErrorsHandler(fakeResult, h);
540 var expected =
new List<string>()
546 "Token 'badtoken' is not recognized.",
549 "mono testapp.exe --input file.bin --output out.bin",
551 "mono testapp.exe -w --input file.bin",
553 "mono testapp.exe -e --input file.bin",
554 "mono testapp.exe --errs --input=file.bin",
556 "mono testapp.exe -l 1,2",
558 "mono testapp.exe value",
560 "-i, --input Set input file.",
562 "-i, --output Set output file.",
564 "--verbose Set verbosity level.",
566 "-w, --warns Log warnings.",
568 "-e, --errs Log errors.",
572 "--help Display this help screen.",
574 "--version Display version information.",
576 "value pos. 0 Value."
579 if (newlineBetweenSections)
580 expected.Insert(5,
"");
582 var text = helpText.ToString();
583 var lines = text.ToLines().TrimStringArray();
585 lines.Should().StartWith(expected);
589 [InlineData(
true,
true)]
590 [InlineData(
true,
false)]
591 [InlineData(
false,
true)]
592 [InlineData(
false,
false)]
604 var helpText =
HelpText.AutoBuild(fakeResult,
607 h.AddNewLineBetweenHelpSections = newlineBetweenSections;
608 h.AddPreOptionsLine((startWithNewline ? Environment.NewLine :
null) +
"pre-options");
609 return HelpText.DefaultParsingErrorsHandler(fakeResult, h);
615 var expected =
new List<string>()
622 "Token 'badtoken' is not recognized.",
629 if (newlineBetweenSections || startWithNewline)
630 expected.Insert(2,
"");
632 var text = helpText.ToString();
633 var lines = text.ToLines().TrimStringArray();
635 lines.Should().StartWith(expected);
642 var handlers =
new CultureInfo(
"en-US").MakeCultureHandlers();
649 handlers.ChangeCulture();
650 var helpText =
HelpText.AutoBuild(fakeResult);
651 handlers.ResetCulture();
655 var lines = text.ToNotEmptyLines().TrimStringArray();
657 lines[4].Should().Be(
"-z, --strseq (Default: a b c)");
658 lines[5].Should().Be(
"-y, --intseq (Default: 1 2 3)");
659 lines[6].Should().Be(
"-q, --dblseq (Default: 1.1 2.2 3.3)");
667 string expectedCopyright = $
"Copyright (C) {DateTime.Now.Year} author";
674 actualResult.
Copyright.Should().Be(expectedCopyright);
681 string expectedTitle =
"Title";
682 string expectedVersion =
"1.2.3.4";
686 new AssemblyTitleAttribute(expectedTitle),
687 new AssemblyInformationalVersionAttribute(expectedVersion)
693 actualResult.
Heading.Should().Be(
string.Format(
"{0} {1}", expectedTitle, expectedVersion));
699 string expectedCompany =
"Company";
703 new AssemblyCompanyAttribute(expectedCompany)
708 bool onErrorCalled =
false;
711 onErrorCalled =
true;
715 onErrorCalled.Should().BeFalse();
716 actualResult.
Copyright.Should().Be(
string.Format(
"Copyright (C) {0} {1}", DateTime.Now.Year, expectedCompany));
722 StringBuilder b =
new StringBuilder();
727 Assert.Equal(
"T" + Environment.NewLine +
"e" + Environment.NewLine +
"s" + Environment.NewLine +
"t", b.ToString());
735 var sut =
new HelpText { AddDashesToOption =
true }
737 Enumerable.Empty<
Error>()));
741 var lines = sut.
ToString().ToNotEmptyLines();
742 lines[0].Should().BeEquivalentTo(
" --stringvalue This is a help text description.");
743 lines[1].Should().BeEquivalentTo(
" It has multiple lines.");
744 lines[2].Should().BeEquivalentTo(
" We also want to ensure that indentation is correct.");
754 var sut =
new HelpText { AddDashesToOption =
true }
756 Enumerable.Empty<
Error>()));
760 var lines = sut.
ToString().ToNotEmptyLines();
761 lines[3].Should().BeEquivalentTo(
" --stringvalu2 This is a help text description where we want");
762 lines[4].Should().BeEquivalentTo(
" the left pad after a linebreak to be honoured so that");
763 lines[5].Should().BeEquivalentTo(
" we can sub-indent within a description.");
773 var sut =
new HelpText { AddDashesToOption =
true, MaximumDisplayWidth = 60 }
775 Enumerable.Empty<
Error>()));
779 var lines = sut.
ToString().ToNotEmptyLines();
780 lines[0].Should().BeEquivalentTo(
" --stringvalue This is a help text description where we");
781 lines[1].Should().BeEquivalentTo(
" want:");
782 lines[2].Should().BeEquivalentTo(
" * The left pad after a linebreak to");
783 lines[3].Should().BeEquivalentTo(
" be honoured and the indentation to be");
784 lines[4].Should().BeEquivalentTo(
" preserved across to the next line");
785 lines[5].Should().BeEquivalentTo(
" * The ability to return to no indent.");
786 lines[6].Should().BeEquivalentTo(
" Like this.");
796 var sut =
new HelpText { AddDashesToOption =
true }
798 Enumerable.Empty<
Error>()));
802 var lines = sut.
ToString().ToNotEmptyLines();
803 lines[0].Should().BeEquivalentTo(
" --stringvalue This is a help text description");
804 lines[1].Should().BeEquivalentTo(
" It has multiple lines.");
805 lines[2].Should().BeEquivalentTo(
" Third line");
815 var sut =
new HelpText { AddDashesToOption =
true, MaximumDisplayWidth = 10 }
817 Enumerable.Empty<
Error>()));
821 Assert.True(sut.ToString().Length > 0);
830 var handlers =
new CultureInfo(
"en-US").MakeCultureHandlers();
834 Enumerable.Empty<
Error>()
838 handlers.ChangeCulture();
839 var helpText =
HelpText.AutoBuild(fakeResult);
840 handlers.ResetCulture();
844 var lines = text.ToLines().TrimStringArray();
846 lines[3].Should().Be(
"-z, --strseq (Default: a b c)");
847 lines[5].Should().Be(
"-y, --intseq (Default: 1 2 3)");
848 lines[7].Should().Be(
"-q, --dblseq (Default: 1.1 2.2 3.3)");
856 var sut =
new HelpText(
headingInfo) { AddDashesToOption =
true, MaximumDisplayWidth = 100 }
861 var lines = text.ToLines().TrimStringArray();
865 lines[1].Should().BeEmpty();
866 lines[2].Should().BeEquivalentTo(
"--stringvalue (Group: string-group) Define a string value here.");
867 lines[3].Should().BeEquivalentTo(
"-s, --shortandlong (Group: string-group) Example with both short and long name.");
868 lines[4].Should().BeEquivalentTo(
"-x Define a boolean or switch value here.");
869 lines[5].Should().BeEquivalentTo(
"--help Display this help screen.");
870 lines[6].Should().BeEquivalentTo(
"--version Display version information.");
876 var sut =
new HelpText(
headingInfo) { AddDashesToOption =
true, MaximumDisplayWidth = 100 }
881 var lines = text.ToLines().TrimStringArray();
885 lines[1].Should().BeEmpty();
886 lines[2].Should().BeEquivalentTo(
"--stringvalue (Group: string-group) Define a string value here.");
887 lines[3].Should().BeEquivalentTo(
"-s, --shortandlong (Group: string-group) Example with both short and long name.");
888 lines[4].Should().BeEquivalentTo(
"-x Define a boolean or switch value here.");
889 lines[5].Should().BeEquivalentTo(
"--help Display this help screen.");
890 lines[6].Should().BeEquivalentTo(
"--version Display version information.");
896 var sut =
new HelpText(
headingInfo) { AddDashesToOption =
true, MaximumDisplayWidth = 100 }
901 var lines = text.ToLines().TrimStringArray();
905 lines[1].Should().BeEmpty();
906 lines[2].Should().BeEquivalentTo(
"--stringvalue (Group: string-group) Define a string value here.");
907 lines[3].Should().BeEquivalentTo(
"-s, --shortandlong (Group: string-group) Example with both short and long name.");
908 lines[4].Should().BeEquivalentTo(
"-x (Group: second-group) Define a boolean or switch value here.");
909 lines[5].Should().BeEquivalentTo(
"-i (Group: second-group) Define a int sequence here.");
910 lines[6].Should().BeEquivalentTo(
"--help Display this help screen.");
911 lines[7].Should().BeEquivalentTo(
"--version Display version information.");
917 [Trait(
"Category",
"CustomHelp")]
920 string expectedCopyright =
"Copyright (c) 2019 Global.com";
921 var expectedHeading =
"MyApp 2.0.0-beta";
925 bool onErrorCalled =
false;
928 ht.AdditionalNewLineAfterOption =
false;
929 ht.Heading =
"MyApp 2.0.0-beta";
930 ht.Copyright =
"Copyright (c) 2019 Global.com";
933 actualResult.
Copyright.Should().Be(expectedCopyright);
934 actualResult.
Heading.Should().Be(expectedHeading);
938 [Trait(
"Category",
"CustomHelp")]
941 string expectedTitle =
"Title";
942 string expectedVersion =
"1.2.3.4";
946 new AssemblyTitleAttribute(expectedTitle),
947 new AssemblyInformationalVersionAttribute(expectedVersion)
955 helpText.ToString().Trim().Should().Be($
"{expectedTitle} {expectedVersion}");
958 [Trait(
"Category",
"CustomHelp")]
970 var helpText =
HelpText.AutoBuild(fakeResult, h => {
971 h.AdditionalNewLineAfterOption =
false;
976 var lines = helpText.ToString().ToLines().TrimStringArray();
980 lines[i++].Should().BeEmpty();
981 lines[i++].Should().BeEquivalentTo(
"-p, --patch Use the interactive patch selection interface to chose which");
982 lines[i++].Should().BeEquivalentTo(
"changes to commit.");
983 lines[i++].Should().BeEquivalentTo(
"--amend Used to amend the tip of the current branch.");
984 lines[i++].Should().BeEquivalentTo(
"-m, --message Use the given message as the commit message.");
985 lines[i++].Should().BeEquivalentTo(
"--help Display this help screen.");
989 [Trait(
"Category",
"CustomHelp")]
1002 var helpText =
HelpText.AutoBuild(fakeResult, h => h);
1005 var lines = helpText.ToString().ToLines().TrimStringArray();
1008 lines[2].Should().BeEmpty();
1009 lines[3].Should().BeEquivalentTo(
"ERROR(S):");
1010 lines[4].Should().BeEquivalentTo(
"Token 'badtoken' is not recognized.");
1011 lines[5].Should().BeEquivalentTo(
"A sequence option 'i' is defined with fewer or more items than required.");
1012 lines[6].Should().BeEmpty();
1013 lines[7].Should().BeEquivalentTo(
"--stringvalue Define a string value here.");
1014 lines[8].Should().BeEmpty();
1015 lines[9].Should().BeEquivalentTo(
"-s, --shortandlong Example with both short and long name.");
1016 lines[10].Should().BeEmpty();
1017 lines[11].Should().BeEquivalentTo(
"-i Define a int sequence here.");
1018 lines[12].Should().BeEmpty();
1019 lines[13].Should().BeEquivalentTo(
"-x Define a boolean or switch value here.");
1020 lines[14].Should().BeEmpty();
1021 lines[15].Should().BeEquivalentTo(
"--help Display this help screen.");
Models an error generated when an unknown verb is detected.
Models an error generated when a user explicitly requests help.
Models an error generated when a user explicitly requests help in verb commands scenario.
static void SetAttributeOverride(IEnumerable< Attribute > overrides)
Assembly attribute overrides for testing.
Models an error generated when a required option is required.
Models an error generated when an option lacks its value.
Models name information, used in CommandLine.Error instances.
Models an error generated when no verb is selected.
It contains a sequence of CommandLine.Error.
Models a null result when constructing a ParserResult<T> in a faling verbs scenario.
Models a parser result. When inherited by CommandLine.Parsed<T>, it contains an instance of type T w...
Models an error generated when a sequence value lacks elements.
void When_help_text_is_longer_than_width_it_will_wrap_around_as_if_in_a_column_given_width_of_100()
void Long_pre_and_post_lines_without_spaces()
static void RenderUsageText_returns_properly_formatted_text()
void Invoking_RenderParsingErrorsText_returns_appropriate_formatted_text()
void Options_Should_Render_OptionGroup_When_Available_And_Should_Not_Render_Required()
void HelpTextHonoursIndentationAfterLineBreaks()
void Create_empty_instance()
void Invoke_AutoBuild_for_Options_returns_appropriate_formatted_text()
void Options_Should_Render_OptionGroup_In_Parenthesis_When_Available()
void HelpTextPreservesIndentationAcrossWordWrap()
void Invoke_AutoBuild_for_Verbs_with_unknown_verb_returns_appropriate_formatted_text()
void AutoBuild_with_custom_help_and_version_request()
void AutoBuild_with_assembly_company_attribute_only()
void Invoke_AutoBuild_for_Verbs_with_specific_verb_returns_appropriate_formatted_text()
void Create_instance_with_options_and_values()
void When_help_text_is_longer_than_width_it_will_wrap_around_as_if_in_a_column_given_width_of_40()
void AutoBuild_when_no_assembly_attributes()
void Add_line_with_two_empty_spaces_at_the_end()
void Options_should_be_separated_by_spaces()
void HelpTextPreservesIndentationAcrossWordWrapWithSmallMaximumDisplayWidth()
void Create_instance_with_enum_options_enabled()
void AutoBuild_with_assembly_title_and_version_attributes_only()
void Invoke_AutoBuild_for_Options_with_Usage_returns_appropriate_formatted_text(bool newlineBetweenSections)
void AutoBuild_with_errors_and_preoptions_renders_correctly(bool startWithNewline, bool newlineBetweenSections)
void When_defined_MetaValue_should_be_rendered()
void Invoke_AutoBuild_for_Verbs_with_specific_verb_returns_appropriate_formatted_text_given_display_width_100()
void Default_set_to_sequence_should_be_properly_printed()
void Create_instance_without_options(bool newlineBetweenSections)
void Invoke_Custom_AutoBuild_for_Verbs_with_specific_verb_and_no_AdditionalNewLineAfterOption_returns_appropriate_formatted_text()
void Invoke_AutoBuild_for_Options_with_custom_help_returns_appropriate_formatted_text()
void AutoBuild_with_custom_copyright_using_onError_action()
void HelpTextIsConsitentRegardlessOfCompileTimeLineStyle()
void HelpTextHonoursLineBreaks()
void Options_Should_Render_Multiple_OptionGroups_When_Available()
void When_help_text_has_hidden_option_it_should_not_be_added_to_help_text_output()
void Long_help_text_without_spaces()
void Create_instance_with_enum_options_disabled()
void Create_instance_with_options(bool newlineBetweenSections)
readonly HeadingInfo headingInfo
Models the copyright part of an help text. You can assign it where you assign any System....
override string ToString()
Returns the copyright as a System.String.
static CopyrightInfo Default
Gets the default copyright information. Retrieved from AssemblyCopyrightAttribute,...
Models the heading part of an help text. You can assign it where you assign any System....
static HeadingInfo Default
Gets the default heading instance. The title is retrieved from AssemblyTitleAttribute,...
override string ToString()
Returns the heading as a System.String.
HelpText AddPreOptionsLine(string value)
Adds a text line after copyright and before options usage strings.
HelpText AddPostOptionsLine(string value)
Adds a text line at the bottom, after options usage string.
static void AddLine(StringBuilder builder, string value, int maximumLength)
string Copyright
Gets or sets the copyright string. You can directly assign a CommandLine.Text.CopyrightInfo instance.
string Heading
Gets or sets the heading string. You can directly assign a CommandLine.Text.HeadingInfo instance.
override string ToString()
Returns the help screen as a System.String.
static TypeInfo Create(Type current)
Models an error generated when an unknown option is detected.
Models an error generated when a user explicitly requests version.
ErrorType
Discriminator enumeration of CommandLine.Error derivates.