- well, doesn't have to be command-line only, but it's starting that way
- want to store transactions in plain text, human readable files
- as designed, you should even be able to go back, hand edit files, and nothing will be damaged
- gets more complicated when we have different files for each month
interface:
- Simply execute the command with arguments specifying the transaction
- Suggestions so far:
debit: remove money, as in writing a check, charging account, etc. <exec> -d 112.43 Paycheck credit: add money, as in deposits <exec> -c 45.18 "November rent" - So, that's <exec> followed by options
- both the -c and -d options take two arguments:
- amount of transaction, interpreted with two decimal points precision, by default
- a comment about the transaction, bounded by quotes if need be
- There will also be an option to simply print out the current balance
- Ability to parse through command line options, and make sense of poorly formed options, to a degree (invert operation on negatives? append or chop off decimals as needed?)
- Ability to write out (usually just append) to files to store transactions for later use
- Ability to read in and calculate current total, based on new, if any, transactions
- Store all information in hidden directory in user's home dir (i.e. ~/.banking-program/<data is here>)
- Support more than one account (so specify account on command-line? default account?)
- Cancel transactions (maybe just do it manually by adding inverse transaction to list)
- to input decimals as numbers, scan through, add and multiply total, then divide by 100
- to calculate current total, put initial balance at top of file, then run through transactions store debits as negative numbers, credits as positive
- store each month in a separate file; when creating new file, carry over last's balance as this's initial balance
- thinking the file will have the following format, in BNF, but left justified
- said format allows us to get an easy initial to work from, and easy identifier ('#') so we know to skip that line in calculating the balance
- Classes? Don't wanna..
- More C like, but with C++ IOStreams for input/output and file handling
- Do separate files for major functions, called in by main()
The common point here is the simple human-readable file format that brinance stores its transactions in. This allows you to use standard UNIX command line tools to pull information from them and edit them. More..