A Program to create and reuse files written in Rust. It puts stuff learned from The Book and the CLI Recipe to practice.
tbd
Commands prepended with a ?
are optional. All paths can either be absolute or relative.
$ temp create <template-key> ?<outputpath>
$ temp create vue src/components/Slider.vue
Generates Slider.vue
at ./src/components/
based on the template saved under the key vue
. If you ommit the <outpath>
the file will be called New.vue
and create in the current directory.
$ temp add <template-key> <path-to-template>
$ temp add mjml src/my-mail.mjml
Adds a template saved under mjml
based on the file located at src/my-mail.mjml
.
$ temp remove <template-key> <path-to-template>
$ temp remove mjml
Removes the template saved under mjml
.
- Use Main function to examplify usage
Modularize functionality
- Have one config object that defines actions and variables
- Create one function to call in order to run the program
- Keep one file that keeps track of all existing templates
Create files based on saved templates
-
Parse the commandline arguments
-
Read file to extract the correct template
-
Create a file at the appropriate location based on the chosen template
-
Change way to store templates
-
Add/Remove Templates to/from file
Add tests to keep current functionality
- Add remote templates
- Use a better suited format to store/access templates (e.g.
json, yml ...
) - Add more properties to templates like
fileEnding
orvariants
- Make it possible to create multiple templates for one
template-key
with one default template. - Add more template options e.g.
defaultName
- Add filetrees to enable templates for projects instead of just files