Fix Usage line when called with --help and fix test cases

This commit is contained in:
Sebastian Messmer 2015-10-24 20:00:54 +02:00
parent 84daca0bc1
commit 868e12183a
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ void Parser::_addPositionalOptionForBaseDir(po::options_description *desc, po::p
}
[[noreturn]] void Parser::_showHelpAndExit() {
cerr << "Usage: cryfs --config configFile [other options] rootDir mountPoint [-- [FUSE Mount Options]]\n";
cerr << "Usage: cryfs [options] rootDir mountPoint [-- [FUSE Mount Options]]\n";
po::options_description desc;
_addAllowedOptions(&desc);
cerr << desc << endl;

View File

@ -53,12 +53,12 @@ TEST_F(ProgramOptionsParserTest, NoSpecialOptions) {
}
TEST_F(ProgramOptionsParserTest, LogfileGiven) {
ProgramOptions options = parse({"./myExecutable", "/home/user/baseDir", "--logfile", "/home/user/logfile", "/home/user/mountDir"});
ProgramOptions options = parse({"./myExecutable", "/home/user/baseDir", "--logfile", "/home/user/mylogfile", "/home/user/mountDir"});
EXPECT_EQ("/home/user/mylogfile", options.logFile().value());
}
TEST_F(ProgramOptionsParserTest, ConfigfileGiven) {
ProgramOptions options = parse({"./myExecutable", "/home/user/baseDir", "--configfile", "/home/user/configfile", "/home/user/mountDir"});
ProgramOptions options = parse({"./myExecutable", "/home/user/baseDir", "--config", "/home/user/myconfigfile", "/home/user/mountDir"});
EXPECT_EQ("/home/user/myconfigfile", options.configFile().value());
}