From d3ea93d13ea7aee6445b1f728994c97027f902d7 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Mon, 18 Jun 2018 17:53:38 +0200 Subject: [PATCH] Updated README.md --- README.md | 13 +++++++++++++ src/main.cc | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 814d3b0..b18124c 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,16 @@ This is a university assignment for which I aim to create an LZW algorithm implementation to create a small tool similar to `gzip` and `gunzip` that can compress and uncompress files in a lossless fashion. This project is written is C++17, compiled with clang under a UNIX environment. Other compilers and environments will not be tested. + +## How to use it + +Currently, five different options are available to the user: +- `-h` or `--help` will show how to use `projet_lzw` +- `-c` or `--compress` tells `projet_lzw` to compress the input file +- `-u` or `--uncompress` tells `projet_lzw` to uncompress the input file +- `-i ` or `--input ` specifies the input file to be compressed or uncompressed (**MANDATORY**) +- `-o ` or `--output ` specifies the name of the output file. If not used, the default output name for compression is `output.lzw`, and the default name for uncompressing is `_uncompressed`. + +By default, `projet_lzw` will uncompress the (mandatory) input file. + +It is planned to add in the future a sixth option, `-p` or `--passes` that will allow to compress multiple times the input file. diff --git a/src/main.cc b/src/main.cc index 9c6d5db..35ae4a4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -53,7 +53,7 @@ void help() { } std::tuple process_args(int t_argc, char *t_argv[]) { - auto ret = std::make_tuple(string{}, string{}, false); + auto ret = std::make_tuple(string{}, string{}, true); while (true) { int option_index = 0; static struct option long_options[] = {