A tool designed to generate code from templates both local and global.
Templates are stored in a hierarchy broken up into three levels. A typical path to a template looks like
<TLC>storehouse-name/storeroom-name/template-name
where TLC is the start character.
All of names in the path are case insensitive.
Below we describe the full and unambiguous way to specify the paths to a template. In is much easier in practice. So after you read the section on the different types of storehouses go down to the practical usage area and will discover the simple way this can be used.
Global store houses are store houses that are available to anyone who uses the machine.
The global store house locations vary with the OS they are typically stored in a folder with the name
.recreate/storehouses/
There is one global storehouse it is populated upon start up initialization that is called the master global store house and
it is stored on the file system with the name master somthing like: .vie/storehouses/master
Paths to the global storehouses start with the /
character. i.e. /storehouse-name/storeroom-name/template-name
To get to the global master store house we can use the name master
or just the /
character again.
i.e. /master/storeroom-name/template-name
or //storeroom-name/template-name
Throughout the rest of the document we will use //
to reference the master global storehouse
User store houses are store houses that are available and managed by the specific user.
The user store house locations is typically stored in a user folder named ~/username/.vie/storehouses
A specific user storehouse can be designated as the master user store house.
Paths to the user storehouses start with the >
character. i.e. >storehouse-name/storeroom-name/template-name
To get to the master user store house we can use the >
character again.
i.e. >>storeroom-name/template-name
Throughout the rest of the document we will use >>
to reference the master user storehouse
Local store houses are store houses anywhere in the file system but in order to use them user must register the local store house with Vie.
Paths to the local storehouses start with the .
character. i.e. .storehouse-name/storeroom-name/template-name
.storeroom-name/template-name
In practice using this is much easier than describing it. You simply specify the name of the template on the command line and Vie will look for the match at the nearest level.
For example to use the msc template you simply specify the name on the command line and Vie will look for the nearest version of that template.
If the user tells Vie to create code using just a template name msc i.e. vie gen -t msc ..additional params..
- It starts by looking for any templates named msc in store houses at the same level as the current working
directory (cwd).
- If there is a local store house immediately below the cwd and it has a single template named msc , use that template
1.If there are multiple local store houses immediately below the cwd with a template named msc
- Look for templates named msc in all local, user and global store houses
- Print out possible matches
- Exit
- If there is a local store house immediately below the folders above the cwd and it has a single template named msc , use that template
1.If there are multiple local store houses immediately below the folders above the cwd with a template named msc
- Look for templates named msc in all local, user and global store houses
- Print out possible matches
- Exit
- If there is a single user store house with a template named msc, use that template
- If there are multiple user store houses with a template named msc
- Look for templates named msc in all local, user and global store houses
- Print out possible matches
- Exit
- If there are multiple user store houses with a template named msc
- If there is a single global store house with a template named msc, use that template
- If there are multiple global store houses with a template named msc
- Look for templates named msc in all local, user and global store houses
- Print out possible matches
- Exit
- If there is a local store house immediately below the cwd and it has a single template named msc , use that template
1.If there are multiple local store houses immediately below the cwd with a template named msc