Skip to content

Commit da88b74

Browse files
committed
Added man page
1 parent c1d47e8 commit da88b74

File tree

2 files changed

+152
-4
lines changed

2 files changed

+152
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ endif
6060
-t deb \
6161
-v $(WISK_VERSION) \
6262
-n wisk \
63-
./.output/wisk64=/usr/local/bin/wisk
63+
./.output/wisk64=/usr/local/bin/wisk \
64+
./docs/wisk.7=/usr/share/man/man7/wisk.7
6465

6566
fpm \
6667
--log error \
@@ -69,7 +70,8 @@ endif
6970
-v $(WISK_VERSION) \
7071
-n wisk \
7172
-a i686 \
72-
./.output/wisk32=/usr/local/bin/wisk
73+
./.output/wisk32=/usr/local/bin/wisk \
74+
./docs/wisk.7=/usr/share/man/man7/wisk.7
7375

7476
@mv ./*.deb ./.output/
7577

@@ -79,14 +81,16 @@ endif
7981
-t rpm \
8082
-v $(WISK_VERSION) \
8183
-n wisk \
82-
./.output/wisk64=/usr/local/bin/wisk
84+
./.output/wisk64=/usr/local/bin/wisk \
85+
./docs/wisk.7=/usr/share/man/man7/wisk.7
8386
fpm \
8487
--log error \
8588
-s dir \
8689
-t rpm \
8790
-v $(WISK_VERSION) \
8891
-n wisk \
8992
-a i686 \
90-
./.output/wisk32=/usr/local/bin/wisk
93+
./.output/wisk32=/usr/local/bin/wisk \
94+
./docs/wisk.7=/usr/share/man/man7/wisk.7
9195

9296
@mv ./*.rpm ./.output/

docs/wisk.7

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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

Comments
 (0)