fix: readme and arg help messages

This commit is contained in:
Karma Riuk 2023-08-27 13:23:34 +02:00
parent f08c406ca2
commit 06306fdf55
2 changed files with 25 additions and 18 deletions

View File

@ -38,24 +38,24 @@ After downloading `maze-solver` from the
[assets of the latest release](releases/latest "Latest release"), you can use [assets of the latest release](releases/latest "Latest release"), you can use
it with the following arguments it with the following arguments
| Short | Long | Default | Description | | Short | Long | Default | Description |
| ----- | ----------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ----- | ----------------- | ---------- | ------------------------------------------------------------------------------------------------ |
| -h | --help | | Print help information | | -h | --help | | Print help information |
| -v | --verbose | 0 | Verbose level of the solver | | -v | --verbose | 0 | Verbose level of the solver see [verbose levels](#verbose-levels) |
| -i | --input | `maze.png` | Input file | | -i | --input | `maze.png` | Input file |
| -o | --output | `sol.png` | Output file | | -o | --output | `sol.png` | Output file |
| | --path-char-in | `' '` | Character to represent the path in an input text file. | | | --path-char-in | `' '` | Character to represent the path in an input text file. |
| | --wall-char-in | `'#'` | Character to represent the wall in an input text file. | | | --wall-char-in | `'#'` | Character to represent the wall in an input text file. |
| | --path-char-out | `' '` | Character to represent the path in an output text file. | | | --path-char-out | `' '` | Character to represent the path in an output text file. |
| | --wall-char-out | `'#'` | Character to represent the wall in an output text file. | | | --wall-char-out | `'#'` | Character to represent the wall in an output text file. |
| | --cell-size-in | 3 | Size of a cell (in pixels) for input file of image type. | | | --cell-size-in | 3 | Size of a cell (in pixels) for input file of image type. |
| | --cell-size-out | 3 | Size of a cell (in pixels) for output file of image type. | | | --cell-size-out | 3 | Size of a cell (in pixels) for output file of image type. |
| -a | --algo | a-star | Algorithm to solve the maze, available options: dfs, bfs, dijkstra, a-star. | | -a | --algo | a-star | Algorithm to solve the maze<br> Available options: <ul><li>dfs<li>bfs<li>dijkstra<li>a-star</ul> |
| | --visualize | | Visualizer the progress of the solver, available options: video, window.<br> Window will give a live feed of the solver, whereas video creates a video --output with mp4 extension. | | | --visualize | | Visualizer the progress of the solver see [visualization methods](#visulazation-methods) |
| | --video-name | `sol.mp4` | Name of the output file if --visualize is set to 'video'. | | | --video-name | `sol.mp4` | Name of the output file if --visualize is set to 'video'. |
| | --video-framerate | 60 | Framerate of the video if --visualize is set to 'video'. | | | --video-framerate | 60 | Framerate of the video if --visualize is set to 'video'. |
For the verbose level of the solver ### Verbose levels
| Level | Description | | Level | Description |
| ----- | ------------------------------------------------------------------------- | | ----- | ------------------------------------------------------------------------- |
@ -64,4 +64,11 @@ For the verbose level of the solver
| 2 | prints the time the solving algorithm took to run | | 2 | prints the time the solving algorithm took to run |
| 3 | prints the time taken by each section (reader, solving algorithm, writer) | | 3 | prints the time taken by each section (reader, solving algorithm, writer) |
### Visualization methods
| option | description |
| ------ | ---------------------------------------------------------------------- |
| window | will give a live feed of the solver |
| video | creates a video where each frame is a step the solving algorithm takes |
<!-- ## Examples --> <!-- ## Examples -->

View File

@ -179,7 +179,7 @@ func parse_arguments() (*reader.ReaderFactory, *writer.WriterFactory, *solver.So
}) })
visFactory.Type = argparser.Selector("", "visualize", visualizer.VIZ_METHODS, &argparse.Options{ visFactory.Type = argparser.Selector("", "visualize", visualizer.VIZ_METHODS, &argparse.Options{
Help: fmt.Sprintf("Visualizer the progress of the solver, available options: %s. Window will give a live feed of the solver, whereas video creates a video --output with mp4 extension", strings.Join(visualizer.VIZ_METHODS, ", ")), Help: fmt.Sprintf("Visualizer the progress of the solver, available options: %s. Window will give a live feed of the solver, whereas video creates a video creates a video where each frame is a step the solving algorithm takes", strings.Join(visualizer.VIZ_METHODS, ", ")),
Default: "", Default: "",
}) })