Conversation
| namespace xlang | ||
| { | ||
| static void write_license(writer& w) | ||
| static void write_prolog(writer& w) |
There was a problem hiding this comment.
Maybe "preamble" rather than "prolog", not to be confused with https://en.wikipedia.org/wiki/Prolog 😉
| { "brackets", 0, 0 }, // Use angle brackets for #includes (defaults to quotes) | ||
| }; | ||
|
|
||
| static void printUsage(writer& w, bool details) |
There was a problem hiding this comment.
The time you're spending with Java is rubbing off on you. 😉
print_usage
| 1900 + tm.tm_year, | ||
| bind_each(printOption, options)); | ||
|
|
||
| if (details) |
There was a problem hiding this comment.
I don't think any of this needs to be in the tool. We can point to the docs page. Beyond that it seems impractical to try to make the tool self-documenting without substantially more effort. I think a list of options is sufficient and perhaps a link to the docs. Then we can focus on having quality detailed usage information in one place (online).
| path Path to winmd file or recursively scanned folder | ||
| local Local ^%WinDir^%\System32\WinMetadata folder | ||
| sdk[+] Current version of Windows SDK [with extensions] | ||
| 10.0.12345.0[+] Specific version of Windows SDK [with extensions] |
There was a problem hiding this comment.
I like 10.0.12345.0 rather than a specific version. 👍
| { "help", 0, cmd::option::no_max, {}, "Show detailed help with examples" }, | ||
| { "root", 0, 1 }, // "Root folder name for projection headers (defaults to winrt) | ||
| { "filter" }, // One or more prefixes to include in input (same as -include) | ||
| { "lib", 0, 1 }, // Specify library prefix (defaults to winrt) |
There was a problem hiding this comment.
Remove "lib" - that was not in the internal version and doesn't work.
There was a problem hiding this comment.
let's rip out the settings.component_lib stuff in a separate PR. for now it's undocumented.
| { "base", 0, 0, {}, "Generate base.h unconditionally" }, | ||
| { "opt", 0, 0, {}, "Generate component projection with unified construction support" }, | ||
| { "help", 0, cmd::option::no_max, {}, "Show detailed help with examples" }, | ||
| { "root", 0, 1 }, // "Root folder name for projection headers (defaults to winrt) |
There was a problem hiding this comment.
Remove "root" - that was not in the internal version and doesn't work.
There was a problem hiding this comment.
also undocumented, so we can remove at leisure
| struct usage_exception {}; | ||
|
|
||
| static void process_args(int const argc, char** argv) | ||
| static std::vector<cmd::option> options |
There was a problem hiding this comment.
I've always wondered, why is this a static std::vector, instead of a constexpr array?
There was a problem hiding this comment.
Because for some weird reason this doesn't work:
std::array<cmd::option, 18> options
{
{ "input", 0 },
{ "reference", 0 },
{ "output", 0, 1 },
{ "component", 0, 1 },
Instead, when I switch to using an array I need to do this:
std::array<cmd::option, 18> options
{
cmd::option{ "input", 0 },
cmd::option{ "reference", 0 },
cmd::option{ "output", 0, 1 },
cmd::option{ "component", 0, 1 },
Not a high priority so haven't dug into why exactly. Uniform initialization and all that... Feel free to fix whatever's wrong.
There was a problem hiding this comment.
Instead of std::array, the terse syntax should work with plain arrays:
constexpr cmd::option[] options
{
{ "input", 0},
{ "reference", 0},|
No idea what happened with the PR - committing and will address any build breaks later. |
No description provided.