Code cleanup
This commit is contained in:
parent
53ba7c9cc9
commit
c2ada74e6b
@ -26,6 +26,7 @@ public:
|
||||
void flushToFile();
|
||||
|
||||
void deleteObject();
|
||||
|
||||
private:
|
||||
const std::string fileName;
|
||||
const std::string homeDirectory = getpwuid(getuid())->pw_dir;
|
||||
|
@ -26,8 +26,7 @@ Data<T>::Data(std::string file) : fileName(std::move(file)) {
|
||||
|
||||
document.Parse(std::string(bytes.data(), fileSize).c_str());
|
||||
chkExistIfs.close();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// File doesnt exist we need to create one
|
||||
// This is the job of the derives constructor.
|
||||
chkExistIfs.close();
|
||||
|
@ -55,7 +55,8 @@ int main(int argc, char *argv[]) {
|
||||
accountOptHandler.help();
|
||||
}
|
||||
if (accountOptHandler.getSetOpts()->create) {
|
||||
accounts.emplace_back(storageD + "accounts/" + accountOptHandler.getSetOpts()->createAccount + ".json", accountOptHandler.getSetOpts()->createAccount);
|
||||
accounts.emplace_back(storageD + "accounts/" + accountOptHandler.getSetOpts()->createAccount + ".json",
|
||||
accountOptHandler.getSetOpts()->createAccount);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -10,11 +10,11 @@ using namespace Budget::OptHandlers;
|
||||
|
||||
void AccountOptHandler::parse() {
|
||||
struct option longOpts[] = {
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
{"list", no_argument, nullptr, 'l'},
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
{"list", no_argument, nullptr, 'l'},
|
||||
{"delete", required_argument, nullptr, 'd'},
|
||||
{"create", required_argument, nullptr, 'c'},
|
||||
{"value", required_argument, nullptr, 'v'},
|
||||
{"value", required_argument, nullptr, 'v'},
|
||||
};
|
||||
|
||||
while (true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user