From 2ecbe281b0351e630c7730b44c1f4a9c3b3062a5 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Sun, 26 Aug 2018 21:22:32 -0400 Subject: Initial commit --- src/Commands/RootCommand.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Commands/RootCommand.cs (limited to 'src/Commands/RootCommand.cs') diff --git a/src/Commands/RootCommand.cs b/src/Commands/RootCommand.cs new file mode 100644 index 0000000..1abab5a --- /dev/null +++ b/src/Commands/RootCommand.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.CommandLineUtils; + +namespace iPhotoExtractor.Commands +{ + public class RootCommand : ICommand + { + public static void Configure(CommandLineApplication app) + { + app.Name = "iPhotoExtractor"; + app.HelpOption("-h|--help"); + + app.Command("preview", PreviewCommand.Configure); + app.Command("extract", ExtractCommand.Configure); + + app.OnExecute(() => + { + (new RootCommand(app)).Run(); + return 0; + }); + } + + private readonly CommandLineApplication _app; + + public RootCommand(CommandLineApplication app) + { + _app = app; + } + + public void Run() + { + _app.ShowHelp(); + } + } +} \ No newline at end of file -- cgit v1.2.3