aboutsummaryrefslogtreecommitdiff
path: root/src/Commands/RootCommand.cs
diff options
context:
space:
mode:
authorGravatar Daniel Smith <rdnlsmith@gmail.com> 2018-08-26 21:22:32 -0400
committerGravatar Daniel Smith <rdnlsmith@gmail.com> 2018-08-26 21:22:32 -0400
commit2ecbe281b0351e630c7730b44c1f4a9c3b3062a5 (patch)
tree4c9ab179dd654230b4f9b29da8437bee9b0fffac /src/Commands/RootCommand.cs
Initial commit
Diffstat (limited to 'src/Commands/RootCommand.cs')
-rw-r--r--src/Commands/RootCommand.cs34
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