Skip to content

Commit fe8dafa

Browse files
Merge pull request #508 from bilal-fazlani/doc-snippets
update doc snippets after modernization
2 parents 0461c6e + 760c64d commit fe8dafa

20 files changed

+77
-88
lines changed

docs/ArgumentValidation/data-annotations-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class Verbosity : IArgumentModel, IValidatableObject
6161
}
6262
}
6363
```
64-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Data_Annotations_Validation.cs#L14-L52' title='Snippet source file'>snippet source</a> | <a href='#snippet-data_annotations_validation' title='Start of snippet'>anchor</a></sup>
64+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Data_Annotations_Validation.cs#L13-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-data_annotations_validation' title='Start of snippet'>anchor</a></sup>
6565
<!-- endSnippet -->
6666

6767
DataAnnotations can be defined on the method parameters and model properties. Notice

docs/ArgumentValidation/fluent-validation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class VerbosityValidator : AbstractValidator<Verbosity>
9292
}
9393
}
9494
```
95-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Fluent_Validation.cs#L16-L85' title='Snippet source file'>snippet source</a> | <a href='#snippet-fluent_validation' title='Start of snippet'>anchor</a></sup>
95+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Fluent_Validation.cs#L13-L82' title='Snippet source file'>snippet source</a> | <a href='#snippet-fluent_validation' title='Start of snippet'>anchor</a></sup>
9696
<!-- endSnippet -->
9797

9898
<!-- snippet: fluent_validation_create_invalid -->
@@ -127,16 +127,16 @@ public static AppRunner AppRunner =>
127127
.UseNameCasing(Case.LowerCase)
128128
.UseFluentValidation(validatorFactory: model =>
129129
{
130-
switch (model)
130+
return model switch
131131
{
132-
case Host: return new HostValidator();
133-
case Table: return new TableValidator();
134-
case Verbosity: return new VerbosityValidator();
135-
default: return null;
136-
}
132+
Host => new HostValidator(),
133+
Table => new TableValidator(),
134+
Verbosity => new VerbosityValidator(),
135+
_ => null
136+
};
137137
});
138138
```
139-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Fluent_Validation.cs#L91-L105' title='Snippet source file'>snippet source</a> | <a href='#snippet-fluent_validation_factory' title='Start of snippet'>anchor</a></sup>
139+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Validation/Fluent_Validation.cs#L88-L102' title='Snippet source file'>snippet source</a> | <a href='#snippet-fluent_validation_factory' title='Start of snippet'>anchor</a></sup>
140140
<!-- endSnippet -->
141141

142142
## vs. DataAnnotations

docs/ArgumentValues/argument-separator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void EndOfOptions(IConsole console, CommandContext ctx, string? arg1)
3838
console.WriteLine($"remaining: {string.Join(',', ctx.ParseResult!.RemainingOperands)}");
3939
}
4040
```
41-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Values/Argument_Separator.cs#L21-L34' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_separator_end_of_options' title='Start of snippet'>anchor</a></sup>
41+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Values/Argument_Separator.cs#L19-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_separator_end_of_options' title='Start of snippet'>anchor</a></sup>
4242
<!-- endSnippet -->
4343

4444
This command expects a single operand, but if the operand value looks like an option, the parser will throw an exception
@@ -142,7 +142,7 @@ public void PassThru(IConsole console, CommandContext ctx, string? arg1)
142142
console.WriteLine($"remaining: {string.Join(',', ctx.ParseResult!.RemainingOperands)}");
143143
}
144144
```
145-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Values/Argument_Separator.cs#L36-L50' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_separator_pass_thru' title='Start of snippet'>anchor</a></sup>
145+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Values/Argument_Separator.cs#L34-L48' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_separator_pass_thru' title='Start of snippet'>anchor</a></sup>
146146
<!-- endSnippet -->
147147

148148
Help will append ` [[--] <arg>...]` to the usage example when `ArgumentSeparatorStrategy.PassThru` is used.

docs/ArgumentValues/piped-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void List(IConsole console,
3434
foreach (var user in userSvc.GetUsers())
3535
console.Out.WriteLine(idsOnly ? user.Id : user);
3636
}
37-
37+
3838
public void Disable(IConsole console, IEnumerable<string> ids)
3939
{
4040
foreach (string id in ids)

docs/Arguments/argument-arity.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ CommandDotNet will check if the minimum or maximum arity has been exceeded and r
5353
<a id='snippet-arguments_arity'></a>
5454
```cs
5555
public void DefaultCommand(Model model,
56-
bool requiredBool, Uri requiredRefType,
57-
bool? nullableBool, Uri? nullableRefType,
58-
bool optionalBool = false, Uri optionalRefType = null)
56+
bool requiredBool, Uri requiredRefType,
57+
bool? nullableBool, Uri? nullableRefType,
58+
bool optionalBool = false, Uri optionalRefType = null)
5959
{}
6060

6161
public class Model : IArgumentModel
@@ -66,7 +66,7 @@ public class Model : IArgumentModel
6666
[Operand] public Uri DefaultRefType { get; set; } = new ("http://apple.com");
6767
}
6868
```
69-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Arguments_Arity.cs#L18-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-arguments_arity' title='Start of snippet'>anchor</a></sup>
69+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Arguments_Arity.cs#L17-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-arguments_arity' title='Start of snippet'>anchor</a></sup>
7070
<!-- endSnippet -->
7171

7272
<!-- snippet: arguments_arity_help -->
@@ -134,7 +134,7 @@ public void DefaultCommand(
134134
[Option] bool[]? nullableBool, [Option] Uri[]? nullableRefType,
135135
[Option] bool[] optionalBool = null, [Option] Uri[] optionalRefType = null)
136136
```
137-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Arguments_Arity.cs#L94-L99' title='Snippet source file'>snippet source</a> | <a href='#snippet-arguments_arity_collection' title='Start of snippet'>anchor</a></sup>
137+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Arguments_Arity.cs#L93-L98' title='Snippet source file'>snippet source</a> | <a href='#snippet-arguments_arity_collection' title='Start of snippet'>anchor</a></sup>
138138
<!-- endSnippet -->
139139

140140
<!-- snippet: arguments_arity_collection_help -->
@@ -188,7 +188,7 @@ public static IArgumentArity ExactlyOne => new ArgumentArity(1, 1);
188188
public static IArgumentArity ZeroOrMore => new ArgumentArity(0, Unlimited);
189189
public static IArgumentArity OneOrMore => new ArgumentArity(1, Unlimited);
190190
```
191-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/ArgumentArity.cs#L37-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-known-arities' title='Start of snippet'>anchor</a></sup>
191+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/ArgumentArity.cs#L39-L45' title='Snippet source file'>snippet source</a> | <a href='#snippet-known-arities' title='Start of snippet'>anchor</a></sup>
192192
<!-- endSnippet -->
193193

194194
The static method `ArgumentArity.Default(IArgument argument)` will return one of these static values based on the type
@@ -228,7 +228,7 @@ public static bool AllowsNone(this IArgumentArity arity) => arity.Minimum == 0;
228228
/// </summary>
229229
public static bool AllowsUnlimited(this IArgumentArity arity) => arity.Maximum == ArgumentArity.Unlimited;
230230
```
231-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/ArgumentArityExtensions.cs#L5-L35' title='Snippet source file'>snippet source</a> | <a href='#snippet-arity-extensions' title='Start of snippet'>anchor</a></sup>
231+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/ArgumentArityExtensions.cs#L8-L38' title='Snippet source file'>snippet source</a> | <a href='#snippet-arity-extensions' title='Start of snippet'>anchor</a></sup>
232232
<!-- endSnippet -->
233233

234234

docs/Arguments/argument-models.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public void Notify(string message, List<string> recipients,
1313
// send notification
1414
}
1515
```
16-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L17-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_without_model' title='Start of snippet'>anchor</a></sup>
16+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L16-L22' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_without_model' title='Start of snippet'>anchor</a></sup>
1717
<!-- endSnippet -->
1818

1919
<!-- snippet: argument_models_notify_without_model_help -->
@@ -71,7 +71,7 @@ public class NotificationArgs : IArgumentModel
7171
public List<string> Recipients { get; set; } = null!;
7272
}
7373
```
74-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L28-L45' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_model' title='Start of snippet'>anchor</a></sup>
74+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L27-L44' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_model' title='Start of snippet'>anchor</a></sup>
7575
<!-- endSnippet -->
7676

7777
<!-- snippet: argument_models_dry_run_and_verbosity -->
@@ -82,7 +82,7 @@ public class DryRunOptions : IArgumentModel
8282
[Option("dryrun")]
8383
public bool IsDryRun { get; set; } = false;
8484
}
85-
85+
8686
public class VerbosityOptions : IArgumentModel, IValidatableObject
8787
{
8888
[Option('v')]
@@ -99,7 +99,7 @@ public class VerbosityOptions : IArgumentModel, IValidatableObject
9999
}
100100
}
101101
```
102-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L168-L190' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_dry_run_and_verbosity' title='Start of snippet'>anchor</a></sup>
102+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L165-L187' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_dry_run_and_verbosity' title='Start of snippet'>anchor</a></sup>
103103
<!-- endSnippet -->
104104

105105
<!-- snippet: argument_models_notify_with_model_help -->
@@ -157,7 +157,7 @@ public class NotificationArgs : IArgumentModel
157157
public VerbosityOptions VerbosityOptions { get; set; } = null!;
158158
}
159159
```
160-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L50-L68' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_model_composed' title='Start of snippet'>anchor</a></sup>
160+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L49-L67' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_model_composed' title='Start of snippet'>anchor</a></sup>
161161
<!-- endSnippet -->
162162

163163

@@ -189,7 +189,7 @@ public class NotificationArgs : IArgumentModel
189189
[Operand]
190190
public List<string> Recipients { get; set; } = null!;
191191
}
192-
192+
193193
public class DryRunOptions : IArgumentModel
194194
{
195195
[Option("dryrun", AssignToExecutableSubcommands = true)]
@@ -205,7 +205,7 @@ public class VerbosityOptions : IArgumentModel
205205
public bool Quite { get; set; }
206206
}
207207
```
208-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L73-L112' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_interceptor' title='Start of snippet'>anchor</a></sup>
208+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L72-L109' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_interceptor' title='Start of snippet'>anchor</a></sup>
209209
<!-- endSnippet -->
210210

211211
<!-- snippet: argument_models_notify_with_interceptor_help -->
@@ -270,7 +270,7 @@ public class NotifyModel : IArgumentModel
270270
public VerbosityOptions VerbosityOptions { get; set; }
271271
}
272272
```
273-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L149-L156' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_invalid_nested_operands_model' title='Start of snippet'>anchor</a></sup>
273+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L146-L153' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_invalid_nested_operands_model' title='Start of snippet'>anchor</a></sup>
274274
<!-- endSnippet -->
275275

276276
And the error received because NotificationArgs contains operands
@@ -298,7 +298,7 @@ public class NotifyModel : IArgumentModel
298298
public VerbosityOptions VerbosityOptions { get; set; }
299299
}
300300
```
301-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L122-L130' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_nested_operands_model' title='Start of snippet'>anchor</a></sup>
301+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Argument_Models.cs#L119-L127' title='Snippet source file'>snippet source</a> | <a href='#snippet-argument_models_notify_with_nested_operands_model' title='Start of snippet'>anchor</a></sup>
302302
<!-- endSnippet -->
303303

304304
### Recommendation

docs/Arguments/argument-types.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public class EnumTypeDescriptor :
8383
IArgumentTypeDescriptor,
8484
IAllowedValuesTypeDescriptor
8585
{
86-
public bool CanSupport(Type type) =>
87-
type.IsEnum;
86+
public bool CanSupport(Type type) => type.IsEnum;
8887

8988
public string GetDisplayName(IArgument argument) =>
9089
argument.TypeInfo.UnderlyingType.Name;
@@ -96,7 +95,7 @@ public class EnumTypeDescriptor :
9695
Enum.GetNames(argument.TypeInfo.UnderlyingType);
9796
}
9897
```
99-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/EnumTypeDescriptor.cs#L6-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_enum' title='Start of snippet'>anchor</a></sup>
98+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/EnumTypeDescriptor.cs#L8-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_enum' title='Start of snippet'>anchor</a></sup>
10099
<!-- endSnippet -->
101100

102101
Use [DelegatedTypeDescriptor](https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/DelegatedTypeDescriptor.cs) just to override the display text or factory method for the type.
@@ -106,7 +105,7 @@ Use [DelegatedTypeDescriptor](https://github.com/bilal-fazlani/commanddotnet/blo
106105
```cs
107106
new DelegatedTypeDescriptor<string>(Resources.A.Type_Text, v => v),
108107
```
109-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/ArgumentTypeDescriptors.cs#L21-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_string' title='Start of snippet'>anchor</a></sup>
108+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/ArgumentTypeDescriptors.cs#L23-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_string' title='Start of snippet'>anchor</a></sup>
110109
<!-- endSnippet -->
111110

112111
See [StringCtorTypeDescriptor](https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/StringCtorTypeDescriptor.cs) and [ComponentModelTypeDescriptor](https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/ComponentModelTypeDescriptor.cs) for examples to create your own.
@@ -116,24 +115,19 @@ See [StringCtorTypeDescriptor](https://github.com/bilal-fazlani/commanddotnet/bl
116115
```cs
117116
public class ComponentModelTypeDescriptor : IArgumentTypeDescriptor
118117
{
119-
public bool CanSupport(Type type)
120-
{
121-
var typeConverter = TypeDescriptor.GetConverter(type);
122-
return typeConverter.CanConvertFrom(typeof(string));
123-
}
118+
public bool CanSupport(Type type) =>
119+
TypeDescriptor.GetConverter(type).CanConvertFrom(typeof(string));
124120

125-
public string GetDisplayName(IArgument argument)
126-
{
127-
return argument.TypeInfo.UnderlyingType.Name;
128-
}
121+
public string GetDisplayName(IArgument argument) =>
122+
argument.TypeInfo.UnderlyingType.Name;
129123

130-
public object? ParseString(IArgument argument, string value)
124+
public object ParseString(IArgument argument, string value)
131125
{
132126
var typeConverter = argument.Arity.AllowsMany()
133127
? TypeDescriptor.GetConverter(argument.TypeInfo.UnderlyingType)
134128
: TypeDescriptor.GetConverter(argument.TypeInfo.Type);
135129
return typeConverter.ConvertFrom(value)!;
136130
}
137131
```
138-
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/ComponentModelTypeDescriptor.cs#L6-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_type_convertor' title='Start of snippet'>anchor</a></sup>
132+
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet/TypeDescriptors/ComponentModelTypeDescriptor.cs#L8-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-type_descriptors_type_convertor' title='Start of snippet'>anchor</a></sup>
139133
<!-- endSnippet -->

docs/Arguments/arguments.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ The OptionAttribute has the following properties:
6161
<a id='snippet-arguments_attributes'></a>
6262
```cs
6363
public void LaunchRocket(
64-
[Operand("planet", Description = "Name of the planet you wish the rocket to go")]
65-
string planetName,
66-
[Option('t', "turbo", Description = "Do you want to go fast?")]
67-
bool turbo,
68-
[Option('a', Description = "Abort the launch before takeoff", BooleanMode = BooleanMode.Explicit)]
69-
bool abort)
64+
[Operand("planet", Description = "Name of the planet you wish the rocket to go")]
65+
string planetName,
66+
[Option('t', "turbo", Description = "Do you want to go fast?")]
67+
bool turbo,
68+
[Option('a', Description = "Abort the launch before takeoff", BooleanMode = BooleanMode.Explicit)]
69+
bool abort)
7070
```
7171
<sup><a href='https://github.com/bilal-fazlani/commanddotnet/blob/master/CommandDotNet.DocExamples/Arguments/Arguments/Arguments_Attributes.cs#L13-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-arguments_attributes' title='Start of snippet'>anchor</a></sup>
7272
<!-- endSnippet -->

0 commit comments

Comments
 (0)