Git Product home page Git Product logo

expenses's Introduction

Langium Expenses

This is a test project using Langium to produce a DSL and CLI

DSL Grammar

  • The DSL accepts files with the extension .exp

  • Expense entity:

    paid amount on 'paymendDate' for 'tag'
    
    paid 125.25 on '10.10.2010' for 'office supplies'
    
  • Income entity:

    received amount on 'paymentDate' from 'tag' 
    
    received 1000 on '01.10.2020' from 'grant'
    
  • amount can have 1 or 2 decimals

  • paymentDate must be in format dd.mm.yyyy

  • tag can be any chain of characters

CLI commands

The CLI has one command to generate a report according to the data found in the .exp file

General use:

report [options] <file>

Arguments:
<file> The path of the file the report is based one (.exp)

Options:
-s | --save <dir> save report as a .txt file in the designated directory
-d | --date <date> filter by desired date
-t | --tag <tag> filter by tag

Examples:

  • Generate a report in the console
    report .\samples\sample.exp
    
  • Generate a report in the console and save a .txt file
    report .\samples\sample.txt -s .\samples\reports\
    
  • Generate a report filtered by date
    report .\samples\sample.txt -d "10.11.2021"
    
  • Generate a report filtered by date and save a .txt file
    report .\samples\sample.txt -d "10.11.2021" -s .\samples\reports\
    
  • Generate a report filtered by tag
    report .\samples\sample.txt -t salary
    
    report .\samples\sample.txt -t "tag with spaces"
    
  • Generate a report filtered by tag and save a .txt file
    report .\samples\sample.txt -t salary -s .\samples\reports\
    
  • Generate a report filtered by date and by tag
    report .\samples\sample.txt -d "10.11.2021" -t salary
    
  • Generate a report filtered by date and tag and save a .txt file
    report .\samples\sample.txt -d "10.11.2021" -t salary -s .\samples\reports\
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.