Add parse_options helper for parsing cmd line args

This commit is contained in:
Andrew Ayer
2014-06-29 13:49:10 -07:00
parent f3390ff7ff
commit bec9e7f318
5 changed files with 198 additions and 45 deletions

View File

@@ -34,6 +34,7 @@
#include "crypto.hpp"
#include "key.hpp"
#include "gpg.hpp"
#include "parse_options.hpp"
#include <cstring>
#include <unistd.h>
#include <iostream>
@@ -188,6 +189,9 @@ try {
} catch (const Crypto_error& e) {
std::cerr << "git-crypt: Crypto error: " << e.where << ": " << e.message << std::endl;
return 1;
} catch (const Option_error& e) {
std::cerr << "git-crypt: Error: " << e.option_name << ": " << e.message << std::endl;
return 1;
} catch (Key_file::Incompatible) {
std::cerr << "git-crypt: This repository contains a incompatible key file. Please upgrade git-crypt." << std::endl;
return 1;