Module: CommandLineFlunky

Defined in:
lib/treasurer.rb

Constant Summary collapse

STARTUP_MESSAGE =
"\n------Treasurer Financial Utility (c) Edmund Highcock------"
MANUAL_HEADER =
<<EOF

-------------Treasurer Financial Utility Manual---------------

  Written by Edmund Highcock (2014)

NAME

  treasurer


SYNOPSIS

  treasurer <command> [arguments] [options]


DESCRIPTION

  Generate a financial report from one or more bank accounts, credit cards
  etc by analysing internet banking sheets. Simple local files can be used to
  customise the reports by adding budgets and categories

EXAMPLES

  treasurer init my_accounts_folder

  treasurer add my_bank_statement.csv

  treasurer report 

  treasurer add_folder folder_of_bank_statements


EOF
COMMANDS_WITH_HELP =
[
  ['add_file', 'add', 2,  'Import a new internet banking spreadsheet for the given account.', ['csv spreadsheet filename', 'account name'], []],
  ['add_folder_of_files', 'addf', 1,  'Import all internet banking spreadsheets within the given folder .', ['folder'], []],
  ['assign', 'ag', 0,  'Assign all transactions an external account.', [], []],
  ['init_root_folder', 'init', 1,  'Create a new folder and initialise it for storing treasurer data.', ['folder'], []],
  ['list_last_updated', 'last', 1,  'For each account, prints the date of the latest entry.', ['folder'], []],
  ['create_report', 'report', 0,  'Generate a detailed report (typeset using latex) showing account activity, spending by category, and projections.', [], [:a, :b, :t]],
  ['status', 'st', 0,  'Print the transactions to screen..', [], [:C]],

]
COMMAND_LINE_FLAGS_WITH_HELP =
[
  ['--after', '-a', GetoptLong::REQUIRED_ARGUMENT, 'Calculate projections up till given number of days after today'],		
  ['--before', '-b', GetoptLong::REQUIRED_ARGUMENT, 'Start budget from given number of days before today'],		
  ['--today', '-t', GetoptLong::REQUIRED_ARGUMENT, "Specify today's date, i.e. change the date on which the report is generated."],		
  ['--coderunner', '-C', GetoptLong::REQUIRED_ARGUMENT, "Options to pass to CodeRunner, the engine which manages the transaction data."],		
  ['--month', '-m', GetoptLong::REQUIRED_ARGUMENT, "Overrides -a, -b and -t and produces a report for a given month"],		
  ['--report-currency', '-r', GetoptLong::REQUIRED_ARGUMENT, "Convert all amounts to the given currency (e.g. GBP) and amalgamate different currency data to form a unified overview."],		
  #['--formats', '-f', GetoptLong::REQUIRED_ARGUMENT, "A list of formats pertaining to the various input and output files (in the order which they appear), separated by commas. If they are all the same, only one value may be given. If a value is left empty (i.e. there are two commas in a row) then the previous value will be used. Currently supported formats are #{SUPPORTED_FORMATS.inspect}. "],		

]
LONG_COMMAND_LINE_OPTIONS =
[
  #["--no-short-form", "", GetoptLong::NO_ARGUMENT, %[This boolean option has no short form]],
]
CLF_BOOLS =

specifying flag sets a bool to be true

[]
CLF_INVERSE_BOOLS =

specifying flag sets a bool to be false

[]
PROJECT_NAME =
'treasurer'
SCRIPT_FILE =

def self.setup(copts) CommandLineFlunkyTestUtility.setup(copts) end

__FILE__

Class Method Summary collapse

Class Method Details

.method_missing(method, *args) ⇒ Object



81
82
83
84
# File 'lib/treasurer.rb', line 81

def self.method_missing(method, *args)
  # 		p method, args
  Treasurer.send(method, *args)
end