From ea6b166ea3de83365d0b56a4e0b4ccb5d4fd05da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Mon, 12 Oct 2020 23:45:06 +0300 Subject: Man pages --- docs/finbudg.1.scd | 40 ++++++++++++++++++++++++ docs/finbudg.5.scd | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 3 +- 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 docs/finbudg.1.scd create mode 100644 docs/finbudg.5.scd diff --git a/docs/finbudg.1.scd b/docs/finbudg.1.scd new file mode 100644 index 0000000..8e3f7e3 --- /dev/null +++ b/docs/finbudg.1.scd @@ -0,0 +1,40 @@ +finbudg(1) + +# NAME + +finbudg - Quick cli tool to calculate your expenses and balance for a set period +of time. + +# SYNOPSIS + +*finbudg* [FLAGS] <_file_> + +# DESCRIPTION + +This program helps you calculate your expenses and balance by providing it with +a file containing a list of expenses made for a specified period of time. See +*finbudg*(5) for more information on the syntax of this file. + +# FLAGS + +*-h, --help * + Prints the list of flags available. + +*-p, --plain* + Don't colorize the output. Can also be set with the *NO_COLOR* environment + variable. + +*--force-color* + Forces colorized output even when piping. Takes precedence over *--plain* + flag and *NO_COLOR* environment variable. + +*-V, --version* + Prints version information and exits. + +# SEE ALSO + +*finbudg*(5) + +# AUTHORS + +Yaroslav de la Peña Smirnov . diff --git a/docs/finbudg.5.scd b/docs/finbudg.5.scd new file mode 100644 index 0000000..72bfd58 --- /dev/null +++ b/docs/finbudg.5.scd @@ -0,0 +1,91 @@ +finbudg(5) + +# NAME + +finbudg - Quick cli tool to calculate your expenses and balance for a set period +of time. + +# DESCRIPTION + +This manual page documents the syntax of the expenses files used by the +*finbudg* program. + +# SYNTAX + +Expenses files used by *finbudg* use the toml file format as their base for the +syntax. + +## PREAMBLE + +The expenses file should contain at the start the following keys: + +*start_date*=YYYY-MM-DD + This is the date when the period for this budget starts, e.g. your payday. + +*end_date*=YYYY-MM-DD + This is the date when the period for this budget ends, e.g. the day before + your next payday. + +*budget*=float64 + A floating point number that represents your budget for the specified period + of time. + +*essential_categories*=String[] + An array of strings representing the categories that you want to take into + account as "essential". _Optional_. + +*[[days]]* + An entry of this type is an entry for the array of tables *days* and + contains the following keys: + + *date*=YYYY-MM-DD + The date for this day when the following expenses were made. + + *[[days.expenses]]* + An entry of this type is an entry for the nested array of tables + *expenses* inside of an entry of type *days*. It may contain the + following keys: + + *name*=String + The name of the product/service/etc. that money was spent + on. + + *price*=float64 + How much money was spent on said product/service/etc. + + *category*=String + The category to which this expense belongs. _Optional_. + + *shared*=uint32 + If more than one, then the amount of people this expense was + shared with. _Optional_. + + *recurring*=bool + Indicates if this is a recurring expense, i.e. one that + repeats for each period of time. For example, electricity + bills. _Optional_. + +# NOTES + +The dates should be in ISO 8601 format with *NO* time in them, e.g. +*2020-04-20*. + +You don't have to include every day in the period in your expenses file if you +didn't spend any money that day. The program will take into account the last +date in the file to count the number of days. Also, the *[[days.expenses]]* key +is optional, you can also include a day and omit the expenses. + +If you're not very familiar with the TOML format, you should take a look at +*https://toml.io/en/v1.0.0-rc.2*. Especially the part about arrays of tables. + +If you're still not sure how the input file should look like, or if you prefer +to learn by example, take a look at *https://github.com/Yaroslav-95/finbudg*. +The README.md includes an example of an expense file. + +# SEE ALSO + +*finbudg*(1) + +# AUTHORS + +Yaroslav de la Peña Smirnov . diff --git a/src/main.rs b/src/main.rs index 5341939..1dd437b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,7 +66,8 @@ fn get_cli_matches() -> ArgMatches<'static> { ) .arg( Arg::with_name("INPUT") - .help("Expenses file in toml format to calculate from.") + .help("Expenses file to calculate from. For more information \ + on the format of this file see 'man 5 finbudg'") .required(true) .index(1), ) -- cgit v1.2.3