Rand Stats

App::Stouch

zef:samy

NAME

stouch - Simple templated file creator

SYNOPSIS

stouch [options] file ...

DESCRIPTION

stouch is a simple program that creates files/directories from pre-existing templates.

By default, stouch determines the template to use by the file suffix.

Templates

A stouch template is a file or directory stored in the stouch template directory, which is determined via either the -t option or the STOUCH_TEMPLATES environment variable. The template file is named after the file it is templating with the '.template' suffix, ie 'raku.template'. To refer to the template, you must either create a file with the name of the template as a file suffix, or manually specify it by the -T option.

# These both create a file using the 'raku.template' template
stouch file.raku
stouch -T=raku file

stouch can also perform basic text substitution when creating files from templates. Template files can contain substitution targets. A substitution target is a string contained in double curly brackets ('{{ ... }}') consisting of alphanumeric characters and underscores. Through the use of the -s option, these substitution targets can be replaced by another string. Consult the documentation for the -s option below for more information.

When generating a templated directory, stouch will recreate the template's directory structure and perform text substitution on each text file in said directory.

OPTIONS

ENVIRONMENT

AUTHOR

Written by Samuel Young, samyoung12788@gmail.com.

COPYRIGHT

Copyright 2024, Samuel Young

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.