aiiie / cram

Functional tests for command line applications
GNU General Public License v2.0
199 stars 51 forks source link

Support for multi-line regex? #14

Open vmrob opened 8 years ago

vmrob commented 8 years ago

I have a situation where the help documentation for an item depends on whether or not a particular plugin is installed:

  available commands:

    COMMAND SECTION

      sub-command               description for subcommand
      other-sub-command         description for other subcommand

    OPTIONAL COMMAND SECTION

      sub-command               description for subcommand
      other-sub-command         description for other subcommand

    OTHER COMMAND SECTION

      sub-command               description for subcommand
      other-sub-command         description for other subcommand

I originally intended to capture that optional section with a multi-line regex expression but I can see that the standard (re) rule doesn't work with that. Is there any current facility to support this?

If not, I would be happy to introduce a patch provided we can agree on a useful syntax.