diff --git a/rinseoffcli/RinseOffCLI.cs b/rinseoffcli/RinseOffCLI.cs new file mode 100644 index 0000000..b1841e1 --- /dev/null +++ b/rinseoffcli/RinseOffCLI.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; +namespace rinseoffcli +{ + class Program + { + + static void showHelp(int exitCode = 1){ + Console.WriteLine("Must specify store or load, then a file name followed by a key file.\nFormat: "); + System.Environment.Exit(exitCode); + } + static void storeData(string filepath, string keypath){ + Stream inputStream = Console.OpenStandardInput(); + if (! File.Exists(keypath)){ + Console.WriteLine("Key file " + keypath + " does not exist"); + System.Environment.Exit(3); + } + + } + static void Main(string[] args) + { + if (args.Length == 0){ + showHelp(); + } + var cmd = args[0].ToLower(); + switch(cmd){ + case "store": + if (args.Length != 3){ + Console.WriteLine("Invalid number of arguments"); + showHelp(2); + } + storeData(args[1], args[2]); + break; + default: + Console.WriteLine("Invalid command"); + showHelp(); + break; + case "help": + case "--help": + case "-h": + showHelp(); + break; + } + } + } +} diff --git a/rinseoffcli/rinseoffcli.csproj b/rinseoffcli/rinseoffcli.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/rinseoffcli/rinseoffcli.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + +