1. 10

  2. 5

    The .NET team had a really neat project that I think was released. They created a declarative command-line argument parser which, in addition to generating the parser, embedded the grammar in a special section of the binary. PowerShell could then read that section and provide rich completions (including help text and so on) that was always in sync with the binary.

    I’d love to see *NIX platforms adopt something like this: a special ELF section that embedded a grammar for the command line and tooling to generate it from getlongopt arguments and richer interfaces. Shells could then parse it on the first invocation of a command and cache it until the binary changed.

    1. 1

      That sounds like a really cool idea. Any idea what the declarative grammar looked like? Was it something akin to what you see in a manpage?