Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelpText.AutoBuild ignores word after last dot in AssemblyTitleAttribute #34

Closed
ericnewton76 opened this issue Nov 4, 2017 · 7 comments

Comments

@ericnewton76
Copy link
Member

Issue by eakoning
Wednesday Jul 15, 2015 at 14:24 GMT
Originally opened as gsscoder/commandline#199


I'm using CommandLine version 1.9.71.2
If i specify an AssemblyTitleAttribute with a dotted name (and I version my tool 1.10.1.* through the AssemblyVersionAttribute) in the project's AssemblyInfo.cs file, e.g.

[assembly: AssemblyTitle("my.favorite.tool")]

the Copyright and Heading properties on HelpText when using the AutoBuild show
my.favorite 1.10.1.27342

Changing the assembly title to

[assembly: AssemblyTitle("my.great.fantastic.favorite.tool")]

changes Copyright and Heading properties to
my.great.fantastic.favorite 1.10.1.27342

It always leaves out the word after the last dot.

When I leave out the AssemblyTitleAttribute all together, the HelpText falls back to the text specified in the AssemblyProductAttribute and that seems to be working fine.

@ericnewton76
Copy link
Member Author

Comment by gsscoder
Thursday Jul 16, 2015 at 03:25 GMT


@eakoning, can you test it with 2.0. Changes to public API are easy even if you use it with multiple verb classes.

The effort to maintain two branch is great for us, but if the problem persists in 2.0 I'll be glad to fix it.

Thank you.

@ericnewton76
Copy link
Member Author

Comment by scadorel
Friday Oct 16, 2015 at 20:50 GMT


Reproduced using latest beta release (2.0.275.0-beta).
Word after the last dot is removed.

The code uses Path.GetFileNameWithoutExtension(titleAttribute.Title) [HeadingInfo.cs] which remove the last word. By default (when creating project in Visual Studio), the project extensions is not given in the assembly info. However, when checking several .net framework assembly and commandline dll, the .dll extension is specified in the assembly title.

public static HeadingInfo Default
        {
            get
            {
                var title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
                    .MapValueOrDefault(
                        titleAttribute => Path.GetFileNameWithoutExtension(titleAttribute.Title),
                        ReflectionHelper.GetAssemblyName());
[assembly: AssemblyTitle("CommandLine.dll")]

@ericnewton76
Copy link
Member Author

Comment by gsscoder
Monday Nov 02, 2015 at 06:20 GMT


Hi, @scadorel, as stated I've recently restored (my) support to the project.

I ping you to tell I'll take care of this, for now.

Giacomo

@ericnewton76
Copy link
Member Author

Comment by scadorel
Thursday Nov 05, 2015 at 23:00 GMT


👍

@ericnewton76
Copy link
Member Author

Comment by nathan-alden
Sunday Sep 24, 2017 at 15:29 GMT


Still running into this with .NET Core 2.0. AssemblyTitle now seems to be automatically generated by Microsoft's project templates and I don't want to turn off auto-generation just to hack AssemblyTitle to get it to work with this library.

Optimally, the help text classes should be modified to better support .NET Core 2.0 defaults.

@ericnewton76
Copy link
Member Author

Comment by nathan-alden
Sunday Sep 24, 2017 at 15:30 GMT


I modified the .csproj and added this element: <AssemblyTitle>My.App.dll</AssemblyTitle>, which causes the correct output to appear when CommandLineParser generates help text. I should not have to do this, though.

nemec added a commit that referenced this issue Aug 7, 2018
Fix not showing correct header info, issue #34
@moh-hassan
Copy link
Collaborator

It's resolved in v2.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants