Skip to content

Commit 137c77b

Browse files
committed
* Rename parameter description to help
> Fixed parsing patameter issues
1 parent 304c012 commit 137c77b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/ExampleApp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ await CommandLine.Console ()
1010
},
1111
"Command description",
1212
new List<FlowCommandParameter> {
13-
FlowCommandParameter.CreateRequired(alias: "param1", description: "parameter description"),
14-
FlowCommandParameter.Create(alias: "param2", description: "parameter2 description"),
13+
FlowCommandParameter.CreateRequired(alias: "param1", help: "parameter description"),
14+
FlowCommandParameter.Create(alias: "param2", help: "parameter2 description"),
1515
}
1616
)
1717
.RunCommandAsync ();

src/FlowCommandLine/CommandLine.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public CommandLine Application ( string applicationName, string version, string
6868
Delegate = @delegate,
6969
Description = description,
7070
Parameters = parameters
71-
.Where ( a => a != null && !string.IsNullOrEmpty ( a.FullName ) )
71+
.Where (
72+
a => a != null && ( !string.IsNullOrEmpty ( a.FullName ) || !string.IsNullOrEmpty ( a.ShortName ) )
73+
)
7274
.ToList ()
7375
};
7476

src/FlowCommandLine/FlowCommandParameter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ public sealed record FlowCommandParameter {
1515

1616
public bool Required { get; init; }
1717

18-
public static FlowCommandParameter Create ( string name = "", string alias = "", string description = "", string property = "" ) {
18+
public static FlowCommandParameter Create ( string name = "", string alias = "", string help = "", string property = "" ) {
1919
return new FlowCommandParameter {
2020
FullName = alias,
2121
ShortName = name,
22-
Description = description,
22+
Description = help,
2323
PropertyName = property,
2424
Required = false
2525
};
2626
}
2727

28-
public static FlowCommandParameter CreateRequired ( string name = "", string alias = "", string description = "", string property = "" ) {
28+
public static FlowCommandParameter CreateRequired ( string name = "", string alias = "", string help = "", string property = "" ) {
2929
return new FlowCommandParameter {
3030
FullName = alias,
3131
ShortName = name,
32-
Description = description,
32+
Description = help,
3333
PropertyName = property,
3434
Required = true
3535
};

0 commit comments

Comments
 (0)