Katteker/Creator/Program.Arguments.cs
2018-08-25 20:42:08 +02:00

55 lines
1.8 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using McMaster.Extensions.CommandLineUtils;
namespace KattekerCreator
{
[Command(Name = "KattekerCreator", Description = "Creates Installation and Update packages.")]
[HelpOption("-?")]
public partial class Program
{
private string _changeLog;
private string _programFile;
private string _outputDir;
[Argument(0, Description = "Path to the program file")]
[FileExists]
[Required]
private string ProgramFile
{
get => _programFile;
set => _programFile = Path.GetFullPath(value);
}
[Option("-L|--changelog", Description = "Path of the changelog file")]
private string ChangeLog
{
get => _changeLog;
set => _changeLog = Path.GetFullPath(value);
}
[Option("-C|--channel", Description = "Channel of releasing")]
private string Channel { get; set; }
[Option("-O|--output", Description = "Directory for the output")]
[Required]
private string OutputDir
{
get => _outputDir;
set => _outputDir = Path.GetFullPath(value);
}
[Option("-P|--publish", Description = "Path for output from the point of view of the application")]
private string PublishDir { get; set; }
[Option("-V|--version", Description = "Override version number of the application")]
private string Version { get; set; }
[Option("-F|--filter", Description = "Filter parameter. Use minimatch pattern.")]
private string FilterAsString { get; set; }
private IEnumerable<string> Filter => string.IsNullOrWhiteSpace(FilterAsString) ? Enumerable.Empty<string>() : FilterAsString.Split(';');
}
}