From f0950ef2cb5e8ae1d0680d122500809601dd9f90 Mon Sep 17 00:00:00 2001 From: Matthew Adams Date: Wed, 19 Apr 2023 10:39:45 +0100 Subject: [PATCH] Added an option to expose the UseRelativeLinePragmas switch on the generator. This enables us to (optionally) restore what was the default behaviour prior to v2.3.0. This commit resolves https://github.com/mono/t4/issues/152 --- dotnet-t4/TextTransform.cs | 5 +++++ dotnet-t4/readme.md | 1 + 2 files changed, 6 insertions(+) diff --git a/dotnet-t4/TextTransform.cs b/dotnet-t4/TextTransform.cs index 2b8e500..17acf98 100644 --- a/dotnet-t4/TextTransform.cs +++ b/dotnet-t4/TextTransform.cs @@ -103,6 +103,11 @@ static int MainInternal (string [] args) "Preprocess the template into class {} for use as a runtime template. The class name may include a namespace.", (s) => preprocessClassName = s }, + { + "l|useRelativeLinePragmas", + "Use relative paths in line pragmas.", + s => generator.UseRelativeLinePragmas = true + }, { "p==|parameter==", "Set session parameter {0:} to {1:}. " + diff --git a/dotnet-t4/readme.md b/dotnet-t4/readme.md index a209a88..ea051a3 100644 --- a/dotnet-t4/readme.md +++ b/dotnet-t4/readme.md @@ -61,6 +61,7 @@ Option | Description `-I=` | Add a `` to be searched when resolving included files `-P=` | Add a `` to be searched when resolving assemblies. `-c`
`--class=` | Preprocess the template into class `` for use as a runtime template. The class name may include a namespace. +`-l`
`--useRelativeLinePragmas` | Use relative paths in line pragmas. `-p`, `--parameter==` | Set session parameter `` to ``. The value is accessed from the template's `Session` dictionary, or from a property declared with a parameter directive: `<#@ parameter name='' type='' #>.`
If the `` matches a parameter with a non-string type, the `` will be converted to that type. `--debug` | Generate debug symbols and keep temporary files. `-v`
`--verbose` | Output additional diagnostic information to stdout.