From ebe8cba9837872de3dd611d6cd615425c51fefec Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 24 Jun 2017 13:36:19 +0300 Subject: Support many bills --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index dd87c22..53b92a0 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,7 @@ Command-line utility The command-line utility `malodivo` provides a means to process input JSON files and output JSON describing the actual amounts that go towards each bill by each district. This utility reads input JSON data from standard input -and writes output JSON data to standard output. _The format of output is -unstable and subject to change_. +and writes output JSON data to standard output. Usage ----- @@ -39,13 +38,12 @@ Options: Examples -------- -We would get this: +Command: ``` $ malodivo < sample/simpleBudget.json -[["Lakos",100],["Palolene",66],["SouthernPalolene",133]] ``` -with this file ([sample/simpleBudget.json](sample/simpleBudget.json)): +Input: ```json { "bills": [ @@ -53,22 +51,76 @@ with this file ([sample/simpleBudget.json](sample/simpleBudget.json)): "name": "An Act to Construct the Great Wall of Malodivo", "ministry": "Defense", "amount": 300 + }, + { + "name": "An Act to Construct Shelters for the Homeless", + "ministry": "Welfare", + "amount": 400 } ], "districts": [ { "name": "Palolene", - "availableFunds": 200 + "amount": 200 }, { "name": "SouthernPalolene", - "availableFunds": 400 + "amount": 400 }, { "name": "Lakos", - "availableFunds": 300 + "amount": 300 } ] } ``` +Output: +```json +[ + { + "bill": { + "amount": 300, + "name": "An Act to Construct the Great Wall of Malodivo", + "ministry": "Defense" + }, + "districts": [ + { + "amount": 100, + "name": "Lakos" + }, + { + "amount": 66, + "name": "Palolene" + }, + { + "amount": 133, + "name": "SouthernPalolene" + } + ] + }, + { + "bill": { + "amount": 400, + "name": "An Act to Construct Shelters for the Homeless", + "ministry": "Welfare" + }, + "districts": [ + { + "amount": 133, + "name": "Lakos" + }, + { + "amount": 88, + "name": "Palolene" + }, + { + "amount": 177, + "name": "SouthernPalolene" + } + ] + } +] + +``` + -- cgit v1.2.3