cmds.secrets.CmdCompileTemplates: Support -ogm

Add support for the -o (--owner) -g (--group) -m (--mode) options.
They allow to specify a default for compiling templates, but _don't_
override what's in the #conf: specification line in .jw-tmpl or
.jw-secret files.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-08 10:41:58 +01:00
commit f3c4a51b85

View file

@ -15,4 +15,11 @@ class CmdCompileTemplates(Cmd): # export
super().__init__(parent, 'compile-templates', help="Compile package template files")
async def _run(self, args: Namespace) -> None:
await self._compile_template_files(args.packages)
attrs = Cmd.Attrs(args.mode, args.owner, args.group, None)
await self._compile_template_files(args.packages, attrs)
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument('--owner', '-o', default=None, help='Default output file owner')
parser.add_argument('--group', '-g', default=None, help='Default output file group')
parser.add_argument('--mode', '-m', default=None, help='Default output file mode')