Skip to content

Commit 5a2f501

Browse files
authored
Document init-library and init-hello (#4)
1 parent 5b0c058 commit 5a2f501

File tree

2 files changed

+73
-20
lines changed

2 files changed

+73
-20
lines changed

index.html

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ <h2><a id="contents"></a> <a href="#contents">≡</a> <a href="#contents">Conten
4242
<li><a href="#cppsm-build-watch"><code>cppsm build-watch</code></a></li>
4343
<li><a href="#cppsm-clone"><code>cppsm clone &lt;url&gt; &lt;branch&gt;</code></a></li>
4444
<li><a href="#cppsm-format"><code>cppsm format</code></a></li>
45-
<li><a href="#cppsm-hello"><code>cppsm hello</code></a></li>
46-
<li><a href="#cppsm-init"><code>cppsm init</code></a></li>
45+
<li><a href="#cppsm-init"><code>cppsm init</code></a><ul>
46+
<li><a href="#init-name"><code>NAME=&#39;...&#39;</code></a></li>
47+
<li><a href="#init-version"><code>VERSION=&#39;v1&#39;|&#39;...&#39;</code></a></li>
48+
</ul>
49+
</li>
50+
<li><a href="#cppsm-init-hello"><code>cppsm init-hello</code></a></li>
51+
<li><a href="#cppsm-init-library"><code>cppsm init-library</code></a></li>
4752
<li><a href="#cppsm-list"><code>cppsm list</code></a></li>
4853
<li><a href="#cppsm-remove"><code>cppsm remove &lt;path&gt;</code></a></li>
4954
<li><a href="#cppsm-setup"><code>cppsm setup</code></a><ul>
@@ -120,8 +125,8 @@ <h2><a id="project-structure"></a> <a href="#contents">≡</a> <a href="#project
120125
<li>any number of executable tests in the <code>testing</code> directory, and</li>
121126
<li>an executable program in the <code>program</code> directory.</li>
122127
</ul>
123-
<p>Try the <code>cppsm hello</code> script. It generates a simple example project that has
124-
essentially the following structure:</p>
128+
<p>Try the <code>cppsm init-hello</code> script. It generates a simple example project that
129+
has essentially the following structure:</p>
125130
<pre><code>CMakeLists.txt
126131
equipment/
127132
testing.cpp/
@@ -173,8 +178,8 @@ <h3><a id="quick-tour"></a> <a href="#contents">≡</a> <a href="#quick-tour">Qu
173178
<pre><code class="hljs lang-bash">mkdir PROJECT &amp;&amp; cd &quot;$_&quot;
174179
git init
175180
cppsm init</code></pre>
176-
<p>Try the hello world example (after <code>init</code>):</p>
177-
<pre><code class="hljs lang-bash">cppsm hello
181+
<p>Try the hello world example:</p>
182+
<pre><code class="hljs lang-bash">cppsm init-hello
178183
cppsm test
179184
.build*/internals/hello</code></pre>
180185
<p>Start hacking:</p>
@@ -215,14 +220,35 @@ <h4><a id="cppsm-format"></a> <a href="#contents">≡</a> <a href="#cppsm-format
215220
<p>Formats project files inplace using
216221
<a target="_blank" href="https://clang.llvm.org/docs/ClangFormat.html">clang-format <i class="fas fa-xs fa-external-link-alt"></i></a> and
217222
<a target="_blank" href="https://prettier.io/">prettier <i class="fas fa-xs fa-external-link-alt"></i></a>.</p>
218-
<h4><a id="cppsm-hello"></a> <a href="#contents"></a> <a href="#cppsm-hello"><code>cppsm hello</code></a></h4>
219-
<p>Creates an example &quot;Hello, world!&quot; program in a freshly initialized project
220-
directory.</p>
221223
<h4><a id="cppsm-init"></a> <a href="#contents"></a> <a href="#cppsm-init"><code>cppsm init</code></a></h4>
222224
<p>Initializes a new C++ project with cppsm configuration files or updates an
223225
existing project to use the latest configuration files. Run <code>cppsm init</code> in the
224226
top-level directory of a fresh git project.</p>
225-
<h4><a id="cppsm-list"></a> <a href="#contents"></a> <a href="#cppsm-list"><code>cppsm list</code></a></h4>
227+
<p>Configuration variables:</p>
228+
<ul>
229+
<li><p><a id="init-name"></a><a href="#init-name"><code>NAME=&#39;...&#39;</code></a> specifies the base name for
230+
the project and defaults to the name of the current directory.</p>
231+
</li>
232+
<li><p><a id="init-version"></a><a href="#init-version"><code>VERSION=&#39;v1&#39;|&#39;...&#39;</code></a> specifies the
233+
version suffix for the project.</p>
234+
</li>
235+
</ul>
236+
<h4><a id="cppsm-init-hello"></a> <a href="#contents"></a> <a href="#cppsm-init-hello"><code>cppsm init-hello</code></a></h4>
237+
<p>Creates an example &quot;Hello, world!&quot; program in a freshly initialized project
238+
directory.</p>
239+
<h4><a id="cppsm-init-library"></a> <a href="#contents"></a> <a href="#cppsm-init-library"><code>cppsm init-library</code></a></h4>
240+
<p>Creates boilerplate for a simple library project with tests in a freshly
241+
initialized project directory.</p>
242+
<pre><code>CMakeLists.txt
243+
internals/
244+
CMakeLists.txt
245+
testing/
246+
compile_synopsis_test.cpp
247+
provides/
248+
CMakeLists.txt
249+
include/
250+
${NAME}_${VERSION}/
251+
synopsis.hpp</code></pre><h4><a id="cppsm-list"></a> <a href="#contents"></a> <a href="#cppsm-list"><code>cppsm list</code></a></h4>
226252
<p>Prints out a dependency tree of submodules. This command exits with an error
227253
code in case any problems are found in the dependency tree.</p>
228254
<h4><a id="cppsm-remove"></a> <a href="#contents"></a> <a href="#cppsm-remove"><code>cppsm remove &lt;path&gt;</code></a></h4>

index.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ See [repositories with the `#cppsm` topic](https://github.com/topics/cppsm).
3434
- [`cppsm build-watch`](#cppsm-build-watch)
3535
- [`cppsm clone <url> <branch>`](#cppsm-clone)
3636
- [`cppsm format`](#cppsm-format)
37-
- [`cppsm hello`](#cppsm-hello)
3837
- [`cppsm init`](#cppsm-init)
38+
- [`NAME='...'`](#init-name)
39+
- [`VERSION='v1'|'...'`](#init-version)
40+
- [`cppsm init-hello`](#cppsm-init-hello)
41+
- [`cppsm init-library`](#cppsm-init-library)
3942
- [`cppsm list`](#cppsm-list)
4043
- [`cppsm remove <path>`](#cppsm-remove)
4144
- [`cppsm setup`](#cppsm-setup)
@@ -94,8 +97,8 @@ A single _target directory_ may simultaneously contain
9497
- any number of executable tests in the `testing` directory, and
9598
- an executable program in the `program` directory.
9699

97-
Try the `cppsm hello` script. It generates a simple example project that has
98-
essentially the following structure:
100+
Try the `cppsm init-hello` script. It generates a simple example project that
101+
has essentially the following structure:
99102

100103
CMakeLists.txt
101104
equipment/
@@ -171,10 +174,10 @@ git init
171174
cppsm init
172175
```
173176

174-
Try the hello world example (after `init`):
177+
Try the hello world example:
175178

176179
```bash
177-
cppsm hello
180+
cppsm init-hello
178181
cppsm test
179182
.build*/internals/hello
180183
```
@@ -257,17 +260,41 @@ Formats project files inplace using
257260
[clang-format](https://clang.llvm.org/docs/ClangFormat.html) and
258261
[prettier](https://prettier.io/).
259262

260-
#### <a id="cppsm-hello"></a> [](#contents) [`cppsm hello`](#cppsm-hello)
261-
262-
Creates an example "Hello, world!" program in a freshly initialized project
263-
directory.
264-
265263
#### <a id="cppsm-init"></a> [](#contents) [`cppsm init`](#cppsm-init)
266264

267265
Initializes a new C++ project with cppsm configuration files or updates an
268266
existing project to use the latest configuration files. Run `cppsm init` in the
269267
top-level directory of a fresh git project.
270268

269+
Configuration variables:
270+
271+
- <a id="init-name"></a>[`NAME='...'`](#init-name) specifies the base name for
272+
the project and defaults to the name of the current directory.
273+
274+
- <a id="init-version"></a>[`VERSION='v1'|'...'`](#init-version) specifies the
275+
version suffix for the project.
276+
277+
#### <a id="cppsm-init-hello"></a> [](#contents) [`cppsm init-hello`](#cppsm-init-hello)
278+
279+
Creates an example "Hello, world!" program in a freshly initialized project
280+
directory.
281+
282+
#### <a id="cppsm-init-library"></a> [](#contents) [`cppsm init-library`](#cppsm-init-library)
283+
284+
Creates boilerplate for a simple library project with tests in a freshly
285+
initialized project directory.
286+
287+
CMakeLists.txt
288+
internals/
289+
CMakeLists.txt
290+
testing/
291+
compile_synopsis_test.cpp
292+
provides/
293+
CMakeLists.txt
294+
include/
295+
${NAME}_${VERSION}/
296+
synopsis.hpp
297+
271298
#### <a id="cppsm-list"></a> [](#contents) [`cppsm list`](#cppsm-list)
272299

273300
Prints out a dependency tree of submodules. This command exits with an error

0 commit comments

Comments
 (0)