Skip to content

Commit b24c640

Browse files
committed
Update README
1 parent 4e92245 commit b24c640

File tree

3 files changed

+46
-25
lines changed

3 files changed

+46
-25
lines changed

BooleanExpressionParser/.vscode/launch.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
"preLaunchTask": "build",
99
"program": "${workspaceFolder}/bin/Debug/net7.0/BooleanExpressionParser.dll",
1010
"args": [
11-
// "table",
11+
"-o",
12+
"basic",
13+
"table",
1214
// "-t ✅",
1315
// "-f ❌",
14-
// "A.B+!A",
15-
// "A+B+C",
16-
// "D_0.D_1"
17-
"convert",
18-
"A.B",
19-
"A+B",
16+
"A.B+!A",
17+
"A+B+C",
18+
"D_0.D_1",
19+
// "convert",
20+
// "A.B",
21+
// "A+B",
2022
// "!(A+B+C)",
2123
// "(((A.B&C) OR A) AND (NOT B + !C)) AND NOT D",
2224
// "[D_0 . !S] + [D_1 . S];S,D_0,D_1",

BooleanExpressionParser/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private static void Main(string[] args)
1919
{
2020
Console.OutputEncoding = Encoding.UTF8;
2121

22-
var rootCommand = new RootCommand();
22+
var rootCommand = new RootCommand(description: "A boolean expression parser and evaluator.");
2323

2424
// Shared arguments
2525
var expressionsArgument = new Argument<string[]>("expression(s)", description: "The boolean expression(s) to evaluate.");

README.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ A simple boolean expression parser written in C#. It parses boolean expressions
88
- [Running](#running)
99
- [Building](#building)
1010
- [Display](#display)
11-
- [Usage](#usage)
12-
- [Truth table generation](#truth-table-generation)
11+
- [Base Command](#base-command)
12+
- [Truth table generation](#truth-table-generation)
13+
- [Notation conversion](#notation-conversion)
1314
- [Expressions](#expressions)
1415
- [Variables](#variables)
1516
- [How it works](#how-it-works)
@@ -39,22 +40,40 @@ The application displays an intuitive, coloured truth table output for each bool
3940
![Sample screenshot](./docs/sample-screenshot.png)
4041

4142

42-
## Usage
43+
## Base Command
44+
`./BooleanExpressionParser [command] [options]`
4345

44-
### Truth table generation
45-
`./BooleanExpressionParser table <expression(s)>`
46-
#### Arguments: <!-- omit in toc -->
47-
- <expression(s)> The boolean expression(s) to evaluate
48-
#### Options: <!-- omit in toc -->
49-
- -t, --true <true> Character to use for true values in the truth table. [default: 1]
50-
- -f, --false <false> Character to use for false values in the truth table. [default: 0]
51-
- -c, --colour-mode, --color-mode <colour-mode> Colour mode to use for the truth table. [default: Foreground] [possible values: [Ff]oreground, [Bb]ackground, [Nn]one]
52-
- --true-colour, --true-color <true-colour> Colour to use for true values in the truth table. [default: green] [possible values: 16 ANSI colours, hex string, rgb string]
53-
- --false-colour, --false-color <false-colour> Colour to use for false values in the truth table. [default: red] [possible values: 16 ANSI colours, hex string, rgb string]
46+
### Options: <!-- omit in toc -->
47+
- `-o`, `--output`, `--output-type` `<Basic|Display>` The output type to use.
5448

55-
More usage options to be implemented in the future.
5649

57-
For help, run `./BooleanExpressionParser --help`. For help with a specific command, run `./BooleanExpressionParser <command> --help`.
50+
## Truth table generation
51+
Converts a boolean expression(s) to prefix notation. If none are provided, the user will be prompted to enter them.
52+
53+
### Usage: <!-- omit in toc -->
54+
`./BooleanExpressionParser table [<expression(s)>...] [options]`
55+
### Arguments: <!-- omit in toc -->
56+
- `<expression(s)>` The boolean expression(s) to evaluate.
57+
### Options: <!-- omit in toc -->
58+
- `-t`, `--true` `<true>` Character to use for true values in the truth table. [default: 1]
59+
- `-f`, `--false` `<false>` Character to use for false values in the truth table. [default: 0]
60+
- `-c`, `--colour-mode`, `--color-mode` `<Background|Foreground|None>` Colour mode to use for the truth table. [default: Foreground] (possible values: [Ff]oreground, [Bb]ackground, [Nn]one)
61+
- `--true-colour`, `--true-color` `<true-colour>` Colour to use for true values in the truth table. [default: green] (possible values: 16 ANSI colours, hex string, rgb string)
62+
- `--false-colour`, `--false-color` `<false-colour>` Colour to use for false values in the truth table. [default: red] (possible values: 16 ANSI colours, hex string, rgb string)
63+
64+
65+
## Notation conversion
66+
Converts a boolean expression(s) to prefix notation. If none are provided, the user will be prompted to enter them.
67+
68+
### Usage: <!-- omit in toc -->
69+
`./BooleanExpressionParser convert [<expression(s)>...] [options]`
70+
### Arguments: <!-- omit in toc -->
71+
- `<expression(s)>` The boolean expression(s) to convert
72+
73+
74+
More commands to be implemented in the future.
75+
76+
For help, run `./BooleanExpressionParser --help`. For help with a specific command, run `./BooleanExpressionParser [command] --help` or `./BooleanExpressionParser --help [command]`.
5877

5978

6079

@@ -137,9 +156,9 @@ For example:
137156
- [x] Improve console output with colours
138157
- [x] Implement command line arguments
139158
- [ ] Add raw output options
140-
- [ ] Output prefix notation
159+
- [x] Output prefix notation
141160
- [ ] Output specific output for given variables
142-
- [ ] Output machine-readable truth table
161+
- [x] Output machine-readable truth table
143162
- [ ] Create UI for the application, either web-based or desktop-based
144163
145164

0 commit comments

Comments
 (0)