BadScript 2
Loading...
Searching...
No Matches
ValueAttribute.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System;
4
5namespace CommandLine
6{
10 [AttributeUsage(AttributeTargets.Property)]
11 public sealed class ValueAttribute : BaseAttribute
12 {
13 private string metaName;
14
18 public ValueAttribute(int index)
19 {
20 Index = index;
21 metaName = string.Empty;
22 }
23
27 public int Index { get; }
28
32 public string MetaName
33 {
34 get => metaName;
35 set => metaName = value ?? throw new ArgumentNullException("value");
36 }
37 }
38}
Models a base attribute to define command line syntax.
Models an value specification, or better how to handle values not bound to options.
ValueAttribute(int index)
Initializes a new instance of the CommandLine.ValueAttribute class.
int Index
Gets the position this option has on the command line.
string MetaName
Gets or sets name of this positional value specification.