diff --git a/README.md b/README.md index d4d1fc4..2cdd240 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,23 @@ ## Description This project is a part of the [Informatics FRS Helper](https://github.com/albugowy15/informatics-frs-helper) project to automatically parse all class schedule from Excel files to MySQL database. +## Supported Commands +- `update` : Parse all class data from Excel then push it to MySQL database or save it to SQL file. +- `compare` : Compare class schedule from database with latest Excel file. + ## Supported Arguments + +### `update` command - `-p --push` : Optional arg to determine wether only to parse excel or also push class to DB - `-f --file` : Required arg for path to excel file - `-s --sheet` : Required arg for excel sheet name - `-o --outdir` : Optional arg to write the sql statement to output directory +### `compare` command +- `-f --file` : Required arg for path to excel file +- `-s --sheet` : Required arg for excel sheet name +- `-o --outdir` : Required arg to write the comparation result to output directory + ## How To Run 1. To be able to run this project, you need to have Rust installed on your computer. You can refer to the following article for instructions on how to install and configure Rust based on your operating system. [Install Rust - Rust Programming Language](https://www.rust-lang.org/tools/install). @@ -47,21 +58,26 @@ This project is a part of the [Informatics FRS Helper](https://github.com/albugo ## Example ``` -auto-frs-schedule --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" +auto-frs-schedule update --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" ``` Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Then, save the output to MySQL database. ``` -auto-frs-schedule -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql +auto-frs-schedule update -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql ``` Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Then, save the output to `result/classes.sql` directory. ``` -auto-frs-schedule --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql +auto-frs-schedule update --push -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/classes.sql ``` Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Push the output to MySQL database and also save the output to `result/classes.sql` directory. +``` +auto-frs-schedule compare -f ~/Downloads/FRS.xlsx -s "Jadwal Kuliah" -o ./result/changes.txt +``` +Open `FRS.xlsx` file from `~/Downloads` directory and parse all class schedule from `Jadwal Kuliah` sheet name. Compare it with existing class schedule from DB. Save the output to `result/changes.txt` directory. + ## Libraries ### calamine Calamine is a pure Rust Excel/OpenDocument Speadsheet file reader: it reads XLSX, XLS, ODS and more.