budget/src/optHandlers/mainOptHandler.cpp

52 lines
2.9 KiB
C++
Raw Normal View History

//
2023-01-15 17:50:01 -06:00
// Created by quentin on 1/8/23.
//
#include "mainOptHandler.h"
2023-01-15 17:50:01 -06:00
#include <iostream>
using namespace Budget::OptHandlers;
2023-01-15 17:50:01 -06:00
MainOptHandler::MainOptHandler(const std::vector<char *> &argv) {
}
void MainOptHandler::help() {
2023-01-15 17:50:01 -06:00
std::cout << "Output of budget." << std::endl;
std::cout << "Usage:" << std::endl;
std::cout << "\tbudget <action> [options] ..." << std::endl;
std::cout << "Actions:" << std::endl;
std::cout << "\t-h --help\t\t\t\tPrints this." << std::endl;
std::cout << "\t-a --account<=STRING>\tManagement tools for an account." << std::endl;
std::cout << "\t-c --create<=STRING>\tCreates a new account with NAME." << std::endl;
std::cout << "\t-e --earn<=STRING>\t\tAdd an earning to an account." << std::endl;
std::cout << "\t-p --payment<=STRING>\tAdd a payment to an account." << std::endl;
std::cout << "Account Options: [-dDv]" << std::endl;
std::cout << "\t-d --delete\t\t\t\tDeletes specified account." << std::endl;
std::cout << "\t--force-delete\t\t\tDeletes the specified account without confirmation." << std::endl;
std::cout << "\t-v --value\t\t\t\tGets the current value of the account." << std::endl;
std::cout << "\t-D --description\t\tChanges the description of the account." << std::endl;
std::cout << "Create Options: [-d]" << std::endl;
std::cout << "\t-d --description\t\tSets a description for an account." << std::endl;
std::cout << "Earn Options: -v [-drD]" << std::endl;
std::cout << "\t-v --value=<FlOAT>\t\tValue for earning." << std::endl;
std::cout << "\t-d --description=<STRING>\tDescription for earning." << std::endl;
std::cout << "\t-r --receipt=<PATH>\t\tPath to file to store in DB as receipt." << std::endl;
std::cout << "\t-D --date=<dd/mm/yyyy>\tDate as dd/mm/yyyy. Default will be today." << std::endl;
std::cout << "\t-t --time=<hh/mm/ss>\t\t24 hour time as hh/mm/ss. Default will be now." << std::endl;
std::cout << "Payment Options: -v [-drD]" << std::endl;
std::cout << "\t-v --value=<FlOAT>\t\tValue for payment." << std::endl;
std::cout << "\t-d --description=<STRING>\tDescription for payment." << std::endl;
std::cout << "\t-r --receipt=<PATH>\t\tPath to file to store in DB as receipt." << std::endl;
std::cout << "\t-D --date=<NUM/NUM/NUM>\t\tDate as dd/mm/yyyy. Default will be today." << std::endl;
std::cout << "\t-t --time=<hh/mm/ss>\t\t24 hour time as hh/mm/ss. Default will be now." << std::endl;
std::cout << std::endl;
std::cout << "Arguments are processed like blocks with each one terminated by the next Action. For example" << std::endl;
std::cout << std::endl;
std::cout << R"(budget -cAcct -eAcct -v10.00 -r"./receipt.pdf" -pAcct -v5.50 -r"./payment.pdf")" << std::endl;
std::cout << std::endl;
std::cout << "Does the following in order:" << std::endl;
std::cout << "Creates an account named Acct with no description." << std::endl;
std::cout << "Earns 10.00 to it with a receipt." << std::endl;
std::cout << "Pays 5.50 to it with a receipt." << std::endl;
}