Add description for each target
See original GitHub issueUse case(s)
Ability to describe each target when specifying --list-targets.
Description
When listing the targets, it would be useful to see a short description that describes what each target does. This would allow a user to get a better understanding without needing to look through the source of each target. The target names should hopefully give some indication, and a description would be able to add further detail.
For example, in one current project, listing the targets with .\build.bat --list-targets writes
agent-zip
build
clean
default
diff
netcore-sln
pack
publish
release-notes
restore
version
With descriptions, this list would be more useful to a user
agent-zip: builds a zip file of all assemblies needed to instrument with `DOTNET_STARTUP_HOOKS`
build: builds all projects
clean: cleans all projects
default: runs the build target
diff: performs a diff on each assembly to understand what has changed
netcore-sln: creates a solution file containing only .NET Core projects
pack: creates nuget packages for all publishable projects
publish: publishes all publishable projects
release-notes: generates github release notes based on issue and PR labels
restore: restores all nuget package dependencies
version: configures the version to run with.
Alternatives
Descriptions and further details could be provided through a chosen command line integration e.g. System.CommandLine, and additional details provided through this, for example, defining sub commands. There might be some difficulty in this approach however in terms of the applicability of arguments in certain contexts - As an example, if a sub command diff is configured with System.CommandLine and the command build.bat diff --list-dependencies is run, System.CommandLine expects --list-dependencies to be a valid argument in the context of the sub command.
Possible implementation(s)
Targethas astring Description {get;}property, which can be set with the ctor- Methods for being able to specify the properties of a target such as
Targets.Target(...)and overloads, accept an additional parameter for the description.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
@adamralph thanks for the shoutout! ❤️ I’ll give it a try now
Thanks for adding in #556, @adamralph 👍