wiz-lang / wiz

A high-level assembly language for writing homebrew software and games on retro console platforms.
http://wiz-lang.org/
Other
405 stars 40 forks source link

Generate documentation from the commandline. #125

Open Bananattack opened 3 years ago

Bananattack commented 3 years ago

Allow various --help commands that one can pass to Wiz, in order to list information about a platform (its registers, operand patterns, instructions, etc), output formats (and their configs), debug formats (and their configs), etc. This would allow generating documentation for a features/platforms/formats Wiz supports that updates automatically as changes/corrections are made from the commandline, which could be piped into .txt file and used to produce documentation for online reference pages.

These features could be compiled for desktop platforms, but omitted for Emscripten if space saving is desired.

This might be complicated to do, but it will make the maintenance of the platform documentation a lot easier, and I think it's just a cool feature to have almost "interactive" help by being able to issue help commands on specific things Wiz already tracks internally.

Some example queries:

wiz --help platform // list all supported platforms
wiz --help platform 6502 register // all info about the registers available (each has a name that can be queired)
wiz --help platform 6502 register a // list everything about the register a and where it is used in patterns, and instructions.
wiz --help platform 6502 pattern // list all available operand patterns (each has a number that can be queried)
wiz --help platform 6502 pattern 123 // list the nth operand pattern and where it is used in instructions
wiz --help platform 6502 instruction // list all available instructions (each has a name (eg. 'push') or operator character sequence (eg. '+#') that can be queried)
wiz --help platform 6502 instruction '+' // list info for the possible overloads of the '+' instruction
wiz --help platform 6502 instruction '+#' // list info for the possible overloads of the '+#' instruction
wiz --help format // list all supported formats
wiz --help format .nes // info about the .nes output format.
wiz --help format .sfc // info about the .sfc output format.
wiz --help debug // list all supported debug formats
wiz --help debug .sym // info about the .sym debug format. (note: this should fail, disambiguate formats with same extension, as multiple debug formats use .sym)
wiz --help debug .sym wla // info about the WLA-DX .sym output format. (note: this disambiguates the .sym file type)