|
| 1 | +.TH wisk 7 "2015-10-22" "version 1.5" |
| 2 | + |
| 3 | +.SH NAME |
| 4 | +wisk |
| 5 | + |
| 6 | +.SH SYNOPSIS |
| 7 | + |
| 8 | +Create projects from parameterized templates |
| 9 | + |
| 10 | +.SH DESCRIPTION |
| 11 | + |
| 12 | +wisk creates projects from parameterized templates. |
| 13 | + |
| 14 | +.SH OPTIONS |
| 15 | + |
| 16 | +wisk [-p] [-l] [-a] [-i] <path/to/skeleton> <path/to/destination> |
| 17 | + |
| 18 | +Usage: |
| 19 | + |
| 20 | +.IP -l |
| 21 | +Causes the program to list all registered templates by name, then immediately exit. |
| 22 | +.IP -i |
| 23 | +Causes the program to inspect the given skeleton (by positional argument 1), print out all of that skeleton's possible parameters, then exit. |
| 24 | +.IP -a |
| 25 | +Causes the program to register the given path (by positional argument 1) as a template. If the path is a *.zip file, it is added to the user's skeleton registry as-is. If the path is a directory, that directory is zipped and added to the user's skeleton registry. In no case will this command ever modify the given directory. |
| 26 | +.IP -p |
| 27 | +Specifies parameters to be used when populating the target project. See "Parameters" for details. |
| 28 | + |
| 29 | +.SH PARAMETERS |
| 30 | +Parameters given to the "-p" flag are expected to be key=value format inside a single string, semicolon-delimited. Example below: |
| 31 | + |
| 32 | +.RS |
| 33 | +.br |
| 34 | +wisk -p "project.param.1=something; project.param.2=foobar" |
| 35 | +.RE |
| 36 | + |
| 37 | +Parameters can be specified as a list by comma-delimiting values. The following example would define "project.list" as a list of values, |
| 38 | +equalling ["foo", "bar", "baz", "quux"] |
| 39 | + |
| 40 | +.RS |
| 41 | +.br |
| 42 | +wisk -p "project.list=foo,bar,baz,quux" |
| 43 | +.RE |
| 44 | + |
| 45 | +.SH PLACEHOLDERS |
| 46 | + |
| 47 | +Placeholders inside of project skeletons should be in the following format: |
| 48 | + |
| 49 | +.RS |
| 50 | +.br |
| 51 | +${{=parameter=}} |
| 52 | +.RE |
| 53 | + |
| 54 | +By convention, parameter names are dot-namespaced. Best practice is to never camelCase, snake-case, or flat_case parameter names. |
| 55 | +Use a namespace approach such as "project.name". |
| 56 | + |
| 57 | +Placeholders can begin with numbers, unlike other frameworks. |
| 58 | +Parameters must not contain square brackets, semicolon, comma, or equals sign ( [ ] ; , = ), and must not begin with a colon ( : ). |
| 59 | + |
| 60 | +.SH PARAMETER JOINS |
| 61 | + |
| 62 | +Placeholders can specify a join character for lists by using the square brackets: |
| 63 | + |
| 64 | +.RS |
| 65 | +.br |
| 66 | +${{=parameter[::]=}} |
| 67 | +.RE |
| 68 | + |
| 69 | +If that skeleton was given a "parameter" value of "foo,bar,baz,quux", the resulting written value would be "foo::bar::baz::quux". |
| 70 | + |
| 71 | +.SH CONTENT AND RECURSIVE PLACEHOLDERS |
| 72 | +A "content placeholder" can be used to create a sequence of values, each using one value from the list of a single parameter. For instance; |
| 73 | + |
| 74 | +.RS |
| 75 | +.br |
| 76 | +${{=:project.properties=}} |
| 77 | +.br |
| 78 | +${{value}}=TRUE |
| 79 | +.br |
| 80 | +${{=;project.properties=}} |
| 81 | +.RE |
| 82 | + |
| 83 | +Would use each value in "project.properties" to generate a line. Given the input: |
| 84 | + |
| 85 | +.RS |
| 86 | +.br |
| 87 | +wisk -p "project.properties=foo,bar,baz,quux" |
| 88 | +.RE |
| 89 | + |
| 90 | +The following would be generated: |
| 91 | + |
| 92 | +.RS |
| 93 | +.br |
| 94 | +foo=TRUE |
| 95 | +.br |
| 96 | +bar=TRUE |
| 97 | +.br |
| 98 | +baz=TRUE |
| 99 | +.br |
| 100 | +quux=TRUE |
| 101 | +.RE |
| 102 | + |
| 103 | +However, this "content placeholder" construct can be used recursively with the recurse reserved placeholder. This is primarily useful for things like Ruby module declarations. Given the below example; |
| 104 | + |
| 105 | +.RS |
| 106 | +.br |
| 107 | +${{=:project.module=}} |
| 108 | +.br |
| 109 | +module ${{value}} |
| 110 | +.br |
| 111 | +${{recurse}} |
| 112 | +.br |
| 113 | +end |
| 114 | +.br |
| 115 | +${{=;project.module=}} |
| 116 | +.RE |
| 117 | + |
| 118 | +With the parameter being; |
| 119 | + |
| 120 | +.RS |
| 121 | +.br |
| 122 | +wisk -p "project.module=My,Sample,Project" |
| 123 | +.RE |
| 124 | + |
| 125 | +The result is: |
| 126 | + |
| 127 | +.RS |
| 128 | +.br |
| 129 | +module My |
| 130 | +.br |
| 131 | +module Sample |
| 132 | +.br |
| 133 | +module Project |
| 134 | +.br |
| 135 | +end |
| 136 | +.br |
| 137 | +end |
| 138 | +.br |
| 139 | +end |
| 140 | +.RE |
| 141 | + |
| 142 | +.SH AUTHOR |
| 143 | +George Lester (glester491@gmail.com) |
| 144 | +https://github.com/Knetic/wisk |
0 commit comments