Exemple #1
0
 static void Main(string[] args)
 {
     InitializeApplicationCommands();
     if (args.Length >= 1 && commandContainer.ContainsCommand(args[0]))
     {
         try
         {
             commandContainer.GetCommand(args[0]).Initialize(args).Execute();
         }
         catch (CryptographicException)
         {
             Console.WriteLine("Incorrect passphrase!");
             Environment.Exit(1);
         }
         catch (DecryptionException)
         {
             Console.WriteLine("Decryption error!");
             Environment.Exit(1);
         }
         catch (Exception)
         {
             Console.WriteLine("Incorrect usage!");
             commandContainer.GetCommand("--help").Execute();
             Environment.Exit(1);
         }
     }
     else
     {
         Console.WriteLine("Incorrect usage!");
         commandContainer.GetCommand("--help").Execute();
         Environment.Exit(1);
     }
 }