2019-12-25 23:08:20 +04:00
|
|
|
Keep track of your piggy bank.
|
|
|
|
|
|
|
|
Every time you put coins in or take them out of your piggy bank, write here down
|
2019-12-29 22:40:50 +04:00
|
|
|
how much did you put or take. So you won't have to spend time counting them when
|
2019-12-25 23:08:20 +04:00
|
|
|
you decide to take them all out.
|
|
|
|
|
|
|
|
Yes, only coins, no banknots. Well, you actually can easily add support for
|
|
|
|
banknots, but table will become indeed wide.
|
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank [OPTIONS] (COINS in FILE [of CURRENCY] | COINS from FILE
|
|
|
|
| show FILE [with t(ransactions)])
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2020-06-07 20:41:17 +04:00
|
|
|
Common options:
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
- `-h,--help` — print this help;
|
2019-12-29 22:40:50 +04:00
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
- `-v,--version` — print program version;
|
2019-12-29 22:40:50 +04:00
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
- `-L,--list-currencies` — list supported currencies and a default one;
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
- `--set-default-currency` — set currency that'll be used as a default;
|
2020-06-05 03:49:23 +04:00
|
|
|
|
2019-12-25 23:08:20 +04:00
|
|
|
## How to put coins in
|
|
|
|
|
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank [-r | --reversed] COINS in FILE [of CURRENCY]
|
2019-12-25 23:08:20 +04:00
|
|
|
```
|
|
|
|
|
2020-06-07 04:59:51 +04:00
|
|
|
`--reversed` flag reverses the order of coins. By default they come from least
|
2019-12-25 23:08:20 +04:00
|
|
|
significant face value to the most significant one and as stated above being
|
|
|
|
complemented from left so a set shorter than number of coins in a currency,
|
2020-06-05 03:49:23 +04:00
|
|
|
e.g. 5 8 4 will be interpreted as 0 0 0 5 8 4. And this flag will make it
|
|
|
|
to be interpreted as 5 8 4 0 0 0. It is convenient if you want to add only
|
|
|
|
coins of low face value (e.g. cents).
|
|
|
|
|
|
|
|
`COINS` is a set of coins' counts separated with space or comma character. For
|
|
|
|
example: 0 5 0 4 6 7. By default trailing zeroes will be added from the left.
|
|
|
|
So if you wrote something like 6 0 5 12 then it will be complemented to
|
|
|
|
0 0 6 0 5 12 if currency has 6 coins.
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2020-06-05 03:49:23 +04:00
|
|
|
`FILE` is a name of a piggy bank file wich may not have a .pb extension at the
|
|
|
|
end, it will be added automatically.
|
|
|
|
|
|
|
|
`CURRENCY` specifies the currency of a new piggy bank. It will not change
|
|
|
|
currency of an existing piggy bank. ISO standard is used, e.g. EUR.
|
|
|
|
Case-insensitive.
|
2019-12-25 23:08:20 +04:00
|
|
|
|
|
|
|
### Examples:
|
|
|
|
|
2019-12-29 22:40:50 +04:00
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank 7 4 3 0 5 in example.pb of EUR
|
|
|
|
piggybank -r 0 4 6 in example
|
2019-12-29 22:40:50 +04:00
|
|
|
```
|
2019-12-25 23:08:20 +04:00
|
|
|
|
|
|
|
## How to take coins out
|
|
|
|
|
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank [-r | --reversed] COINS from FILE
|
2019-12-25 23:08:20 +04:00
|
|
|
```
|
|
|
|
|
2020-06-05 03:49:23 +04:00
|
|
|
All the parameters are explained above.
|
2019-12-25 23:08:20 +04:00
|
|
|
|
|
|
|
### Examples:
|
|
|
|
|
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank -r 0 0 4 from example.pb
|
2019-12-25 23:08:20 +04:00
|
|
|
```
|
|
|
|
|
2020-06-06 03:00:36 +04:00
|
|
|
## How to see what you have in there
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2019-12-29 22:40:50 +04:00
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank show FILE [with t(ransactions)]
|
2019-12-29 22:40:50 +04:00
|
|
|
```
|
2019-12-25 23:08:20 +04:00
|
|
|
|
2020-06-05 03:49:23 +04:00
|
|
|
It will print a summary table of what is stored in a piggy bank.
|
|
|
|
|
|
|
|
`with t(ransactions)` will print also a table of all transactions stored in a
|
|
|
|
file.
|
2019-12-25 23:08:20 +04:00
|
|
|
|
|
|
|
### Examples:
|
|
|
|
|
|
|
|
```bash
|
2020-06-07 04:59:51 +04:00
|
|
|
piggybank show example.pb with t
|
2020-06-06 03:00:36 +04:00
|
|
|
```
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
|
|
|
|
Configuration file `piggybank.conf` is stored in directory specified by
|
|
|
|
`$XDG_CONFIG_HOME` environment variable or, if it isn't set, in `$HOME/.config`
|
|
|
|
on Linux and in `%APPDATA%` on Windows.
|
|
|
|
|
|
|
|
By default it has following content:
|
|
|
|
|
|
|
|
default-currency = SRUB
|
|
|
|
|
|
|
|
Aside from `default-currency` there is also a `currency.*` parameter. `*` is a
|
|
|
|
currency's ISO code, e.g. `currency.RUB`, `currency.USD`, `currency.EUR` etc.
|
|
|
|
This parameter allows you to add a currency needed for you, but not presented in
|
|
|
|
program.
|
|
|
|
|
|
|
|
Currency is defined following way:
|
|
|
|
|
|
|
|
currency.ISO = ISO;NAME;DESCRIPTION;COINS_COUNT;COINS_NAME;FACE_VALUES
|
|
|
|
|
|
|
|
That is best described with an example. Here it is:
|
|
|
|
|
2020-06-07 20:41:17 +04:00
|
|
|
currency.EXM = EXM;Example;Example currency;2;1E,2E;100,200
|
2020-06-06 03:00:36 +04:00
|
|
|
|
|
|
|
Yes, long and clunky way... May be I'll come up with something better.
|