mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
tools/generate-wire.py: add --include argument for putting #includes in spec-generated files.
We need this for bolt13. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -547,6 +547,9 @@ def main(options, args=None, output=sys.stdout, lines=None):
|
|||||||
|
|
||||||
# Create a new 'master' that serves as the coordinator for the file generation
|
# Create a new 'master' that serves as the coordinator for the file generation
|
||||||
master = Master()
|
master = Master()
|
||||||
|
for i in options.include:
|
||||||
|
master.add_include('#include <{}>'.format(i))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
ln, line = next(genline)
|
ln, line = next(genline)
|
||||||
@@ -689,6 +692,7 @@ if __name__ == "__main__":
|
|||||||
action="store_true", default=False)
|
action="store_true", default=False)
|
||||||
parser.add_argument("--page", choices=['header', 'impl'], help="page to print")
|
parser.add_argument("--page", choices=['header', 'impl'], help="page to print")
|
||||||
parser.add_argument('--expose-tlv-type', action='append', default=[])
|
parser.add_argument('--expose-tlv-type', action='append', default=[])
|
||||||
|
parser.add_argument('--include', action='append', default=[])
|
||||||
parser.add_argument('header_filename', help='The filename of the header')
|
parser.add_argument('header_filename', help='The filename of the header')
|
||||||
parser.add_argument('enum_name', help='The name of the enum to produce')
|
parser.add_argument('enum_name', help='The name of the enum to produce')
|
||||||
parser.add_argument("files", help='Files to read in (or stdin)', nargs=REMAINDER)
|
parser.add_argument("files", help='Files to read in (or stdin)', nargs=REMAINDER)
|
||||||
|
|||||||
Reference in New Issue
Block a user