CommandLineUtils icon indicating copy to clipboard operation
CommandLineUtils copied to clipboard

Documentation is incomplete for CommandAttribute

Open MisinformedDNA opened this issue 5 years ago • 3 comments

Describe the bug Documentation is missing as to how the highest level CommandAttribute is being used.

To Reproduce Steps to reproduce the behavior:

  1. Clone code
  2. Notice that this line mentions the command "fake-docker":
    [Command(Name = "fake-docker", Description = "A self-sufficient runtime for containers"), ...]
  1. Build all
  2. Try to figure out how "fake-docker" is used.

Expected behavior

Not sure, is "fake-docker" supposed to be the app name? A sub-command? Or should it not be there?

Actual behavior

.build directory doesn't contain anything named fake-docker

dotnet .\NestedTypeSubcommands.dll fake-docker results in the error:

Unrecognized command or argument 'fake-docker'

MisinformedDNA avatar Oct 15 '19 17:10 MisinformedDNA

It's used in help text generation. Try running the sample with --help and you should see it mentioned there. The value is meant to match the name of the .exe for your app. I suppose the samples should be updated to indicate this.

natemcmaster avatar Oct 20 '19 18:10 natemcmaster

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.

stale[bot] avatar Jul 21 '21 02:07 stale[bot]

I still don't see where fake-docker is used? It seems like it is defined for no reason.

All commands with fake-docker fail:

❯ dotnet .\NestedTypeSubcommands.dll fake-docker Specify --help for a list of available options and commands. Unrecognized command or argument 'fake-docker' ❯ dotnet .\NestedTypeSubcommands.dll fake-docker --help Specify --help for a list of available options and commands. Unrecognized command or argument 'fake-docker' ❯ dotnet .\NestedTypeSubcommands.dll fake-docker image --help Specify --help for a list of available options and commands. Unrecognized command or argument 'fake-docker'

What does work is to ignore the fake-docker command:

❯ dotnet .\NestedTypeSubcommands.dll --help A self-sufficient runtime for containers

Usage: fake-docker [command] [options]

Options: -?|-h|--help Show help information.

Commands: containers Manage containers image Manage images

Run 'fake-docker [command] -?|-h|--help' for more information about a command.

❯ dotnet .\NestedTypeSubcommands.dll image --help Manage images

Usage: fake-docker image [command] [options]

Options: -?|-h|--help Show help information.

Commands: ls List images

Run 'image [command] -?|-h|--help' for more information about a command.

There is also no exe named fake-docker.

So again, what is the point of defining fake-docker if it's not used anywhere?

MisinformedDNA avatar Aug 26 '21 17:08 MisinformedDNA

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.

github-actions[bot] avatar Aug 27 '22 02:08 github-actions[bot]

Closing due to inactivity. If you are looking at this issue in the future and think it should be reopened, please make a commented here and mention natemcmaster so he sees the notification.

github-actions[bot] avatar Sep 11 '22 02:09 github-actions[bot]