// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Tools.DotNETCommon
{
///
/// Attribute to indicate the name of a command line argument
///
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
public class CommandLineAttribute : Attribute
{
///
/// Prefix for the option, with a leading '-' and trailing '=' character if a value is expected.
///
public string Prefix;
///
/// Specifies a fixed value for this argument. Specifying an alternate value is not permitted.
///
public string Value = null;
///
/// Whether this argument is required
///
public bool Required;
///
/// For collection types, specifies the separator character between multiple arguments
///
public char ListSeparator = '\0';
///
/// Constructor
///
/// Prefix for this argument
public CommandLineAttribute(string Prefix = null)
{
this.Prefix = Prefix;
if(Prefix != null)
{
if(!Prefix.StartsWith("-"))
{
throw new Exception("Command-line arguments must begin with a '-' character");
}
}
}
}
}