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

Add ArgDisplayName attribute. #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Anjw14
Copy link

@Anjw14 Anjw14 commented Jul 24, 2019

Hi,
as #143, sometimes we need to set argument name different with property name or method name, so I add the ArgDisplayName attribute to do this. The ArgDisplayName attribute can be set to both property and action method. See the DisplayNameTests.cs for the specific usage format.

}
}
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code.

/// <summary>
/// Use this attribute to customize your property argument's name to display.
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Class)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AttributeUsageAttribute.AllowMultiple = false

/// Use this attribute to customize your property argument's name to display.
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Class)]
public class ArgDisplayName : Attribute, IGlobalArgMetadata

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attribute class name should end with "Attribute"

@@ -162,6 +162,7 @@ These attributes can be specified on argument properties. PowerArgs uses this me

* `[ArgPosition(0)]` This argument can be specified by position (no need for -propName)
* `[ArgShortcut("n")]` Lets the user specify -n
* `[ArgDisplayName("displayName")]` A customized argument property name or action method name to display.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer ArgLongName

@Anjw14
Copy link
Author

Anjw14 commented Aug 6, 2019

@adamabdelhamed Any comments or suggestions are welcome :)

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

Successfully merging this pull request may close these issues.

2 participants