cgmb / guardonce

Utilities for converting from C/C++ include guards to #pragma once and back again.
MIT License
142 stars 3 forks source link

Path pattern argument not optional #19

Closed cgmb closed 6 years ago

cgmb commented 6 years ago

The argument to path is supposed to be optional, but guardonce will complain about a missing argument if there is any filter following it.

For example:

cgmb@localhost:~/abseil-cpp$ checkguard -r -o guard -p 'path | upper | append _' absl
Missing argument from "path" in pattern

Workaround: Put a big number for the path depth. As long as the actual path depth is smaller than that, the behaviour will be the same as not supplying an argument.