diff options
Diffstat (limited to 'src/Commands/RootCommand.cs')
-rw-r--r-- | src/Commands/RootCommand.cs | 34 |
1 files changed, 34 insertions, 0 deletions
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 |