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

Explicitly indicate "None" if no items for Inputs or Outputs sections #11

Closed
msorens opened this issue Dec 4, 2015 · 3 comments
Closed

Comments

@msorens
Copy link
Contributor

msorens commented Dec 4, 2015

If the Inputs or Outputs section of the help content has no entries, I think it would be much cleaner to add a dummy node in the MAML so that it outputs, e.g. "-None-" or "None". While helpful to both sections, the situation is particularly egregious if the Outputs section is empty (because .NET does not put a header on the Examples section-aarrgh!), currently:

INPUTS
    Data.VersionInfo

OUTPUTS

  ----------  EXAMPLE 1  ----------

So we could at least make it read a bit better:

INPUTS
    Data.VersionInfo

OUTPUTS
    -None-

  ----------  EXAMPLE 1  ----------
@ChrisLambrou
Copy link
Contributor

This could be misleading if a cmdlet doesn't explicitly declare its output type, but it nonetheless does write objects to the pipeline. I think it aids adoption if a user can add XmlDoc2CmdletDoc to their project and it immediately generates useful help files, even without having written any specific XML Doc comments. This proposed change goes against that.

We could emit an output type of None if the output type is explicitly declared as void - i.e. [OutputType(typeof(void))] - but I'm not sure this is all that useful.

@msorens
Copy link
Contributor Author

msorens commented Apr 14, 2016

You present a good argument against my suggestion, Chris, so I am on board with skipping it. Furthermore, I actually do like your counter-proposal (explicitly declaring void to get "None") because that: (a) gives the user the choice whether to use the feature or not, and (b) promotes completeness in coding, if you will. By that I mean, that it should be a best practice to always specify an output type, otherwise, a reader could always have the question of whether the cmdlet actually has no output or the author simply forgot to specify it. (I have not done this before, but I think I will going forward.)

@ChrisLambrou
Copy link
Contributor

Fixed in 0.2.1.

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