Skip to content

Commit

Permalink
Add usage section to the readme (cli).
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Jul 2, 2016
1 parent d96be3a commit f5cc7df
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/trucks-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ npm i trucks-cli --save-dev

- [Install](#install)
- [Documentation](#documentation)
- [Usage](#usage)
- [Completion](#completion)
- [Developer](#developer)
- [Build](#build)
Expand All @@ -50,6 +51,30 @@ If the program is installed globally the man page will be installed:
man trucks
```

## Usage

To compile components to the current working directory:

```shell
trucks src/*.html
```

Will generate `components.html`, `components.css` and `components.js` in the current working directory. The output file name is `components` by default use the `--name` option to change the name of the generated files.

Use the `--out` option to specify the output directory:

```shell
trucks src/*.html -o build
```

Configuration files can be loaded and merged with the default options using the `--conf` option:

```shell
trucks src/*.html -o build --conf options.js
```

For full documentation see the [man page](https://github.com/tmpfs/trucks/blob/master/packages/trucks-cli/doc/man/trucks.1).

## Completion

Completion is available for zsh. To install copy [_trucks](https://github.com/tmpfs/trucks/blob/master/packages/trucks-cli/doc/zsh/_trucks) to a directory in `$fpath`, see the [completion docs](https://github.com/mkdoc/mkcli#completion) for more information.
Expand Down
1 change: 1 addition & 0 deletions packages/trucks-cli/doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Command line interface for the [trucks][] libary.

<? @include {=readme}
documentation.md
usage.md
completion.md
developer.md
license.md
Expand Down
23 changes: 23 additions & 0 deletions packages/trucks-cli/doc/readme/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Usage

To compile components to the current working directory:

```shell
trucks src/*.html
```

Will generate `components.html`, `components.css` and `components.js` in the current working directory. The output file name is `components` by default use the `--name` option to change the name of the generated files.

Use the `--out` option to specify the output directory:

```shell
trucks src/*.html -o build
```

Configuration files can be loaded and merged with the default options using the `--conf` option:

```shell
trucks src/*.html -o build --conf options.js
```

For full documentation see the [man page](/packages/trucks-cli/doc/man/trucks.1).

0 comments on commit f5cc7df

Please sign in to comment.