overtools / OWLib

Toolchain that lets you interact with the Overwatch files and extract models and stuff.
MIT License
362 stars 42 forks source link

Make the help more clear for DataTool #50

Closed justalemon closed 5 years ago

justalemon commented 6 years ago

Currently, when you run DataTool without arguments the output is:

D:\Proyectos\OWLib\dist\Debug>DataTool.exe
[Core] DataTool v1.27.0.0-git-tanklib
[Core] CommandLine: []
DataTool.exe [--flags] [directory] [mode]
...

Anyone that tries this to use it for the first time would think that the following is valid:

D:\Proyectos\OWLib\dist\Debug>DataTool --convert-sound "E:\Overwatch" extract-unlocks

But instead you get:

D:\Proyectos\OWLib\dist\Debug>DataTool --convert-sound "E:\Overwatch" extract-unlocks
[Core] DataTool v1.27.0.0-git-tanklib
[Core] CommandLine: ["--convert-sound", "E:\Overwatch", "extract-unlocks"]
[Core] CommandLineFile: D:\Proyectos\OWLib\dist\Debug\DataTool.exe.args
Positional 2 is required
DataTool.exe [--flags]

You might be thinking, what is the problem? Well, the correct format is:

DataTool.exe [--flags] [overwatch directory] [mode] [output directory] [stuff to extract]

Take the following as an example, that works perfectly for me:

DataTool.exe --convert-sound "E:\Overwatch" extract-unlocks "E:\Overwatch Dump" "D.Va"

If I manage to know how it works, I might send a PR to fix this.

yretenai commented 6 years ago

The way it works is that there's a "Program Flags" which is used for the help output: https://github.com/overtools/OWLib/blob/develop/DataTool/ToolFlags.cs and then there are "Tool Flags" which are specific to the tools. https://github.com/overtools/OWLib/blob/develop/DataTool/ToolLogic/Extract/ExtractFlags.cs#L6 Run DataTool --help, it will show you the flags.

We could show the help for each of the flags, but I think that will end up becoming somewhat of a data overload.

justalemon commented 6 years ago

I mean, there is a bunch of options thrown up in different orders that you don't end up knowing what it does. Take flake8's flags or options as an example:

C:\Users\lemon>flake8 -h
Usage: flake8 [options] file file ...

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -v, --verbose         Print more information about what is happening in
                        flake8. This option is repeatable and will increase
                        verbosity each time it is repeated.
  -q, --quiet           Report only file names, or nothing. This option is
                        repeatable.
  --count               Print total number of errors and warnings to standard
                        error and set the exit code to 1 if total is not
                        empty.
...

You can see that every parameter ordered from top to bottom with a short readable description, there is about 30-40 parameters and you can read every single one.

While the output of DataTool is a complete mess:

D:\Proyectos\OWLib\dist\Debug>DataTool.exe --help
[Core] DataTool v1.27.0.0-git-tanklib
[Core] CommandLine: ["--help"]
DataTool.exe [--flags] [directory] [mode]

Flags:
  flag                              | help                                                                           | default
-----------------------------------------------------------------------------------------------------------------------------------
  --language -L --lang              | Language to load (Needs Value)                                                 |
  ...

Positionals:
  index | positional | help
---------------------------------------------
  0     | directory  | Overwatch Directory
  1     | mode       | Extraction Mode

Modes:
  mode                    | description                               {0, -23} | {1, -40}
----------------------------------------------------------------------------------------------
  dump-strings            | Dump strings  {0, -23} | {1}
  ...

Flags for dump-*Flags for {0}-*

  flag     | help                  | default
-------------------------------------------------
  --json   | Output JSON to stderr | False
  --out -o | Output JSON file      |

Flags for extract-*Flags for {0}-*

  flag                        | help                                          | default
--------------------------------------------------------------------------------------------
  --convert-textures-type     | Texture output type                           | tif
  ...

  index | positional | help
---------------------------------------------
  2     |            | Output path (Required)

Flags for list-*Flags for {0}-*

  flag     | help                  | default
-------------------------------------------------
  --json   | Output JSON to stderr | False
  --out -o | Output JSON file      |