commandlineparser / commandlineparser/commandline

Incorrent argument checks in HeadingInfo.cs

Ouverte
#109 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C#
Étoiles
4.8k
Forks
478
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**Issue by [zii-dmg](https://github.com/zii-dmg)**
_Friday Jan 20, 2017 at 15:30 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/408_

----

[Constructor](https://github.com/gsscoder/commandline/blob/master/src/CommandLine/Text/HeadingInfo.cs#L30):
```
public HeadingInfo(string programName, string version = null)
{
if (string.IsNullOrWhiteSpace("programName")) throw new ArgumentException("programName");
```
Passing string `"programName"` instead of argument `programName` value. But HeadingInfo.Empty is creating object with empty string! So I suppose this check should removed and xml comment with exception description.

[WriteMessage](https://github.com/gsscoder/commandline/blob/master/src/CommandLine/Text/HeadingInfo.cs#L104):
```
if (string.IsNullOrWhiteSpace("message")) throw new ArgumentException("message");
```
Same - `"message"` vs `message`.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.