// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
namespace CommandLine
{
///
/// Models an value specification, or better how to handle values not bound to options.
///
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class ValueAttribute : BaseAttribute
{
private readonly int index;
private string metaName;
///
/// Initializes a new instance of the class.
///
public ValueAttribute(int index) : base()
{
this.index = index;
this.metaName = string.Empty;
}
///
/// Gets the position this option has on the command line.
///
public int Index
{
get { return index; }
}
///
/// Gets or sets name of this positional value specification.
///
public string MetaName
{
get { return metaName; }
set
{
metaName = value ?? throw new ArgumentNullException("value");
}
}
}
}