# c-watch

> uses gulp to watch c files and run make command on changes.

Latest version **0.0.7** (published 2015-11-10) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install c-watch
pnpm add c-watch
yarn add c-watch
bun add c-watch
```

Provides the command `c-watch`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2015-11-10 |
| First published | 2015-10-18 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Will Olson |
| Maintainers | wko |
| Keywords | gulp, c, c++, watcher, make |

## Links

- npm: https://www.npmjs.com/package/c-watch
- Repository: https://github.com/William-Olson/c-watch
- Homepage: http://github.com/William-Olson/c-watch
- Issues: https://github.com/William-Olson/c-watch/issues
- npm.io page: https://npm.io/package/c-watch

## Dependencies (2)

- [gulp](https://npm.io/package/gulp.md) ~3.9.0
- [shelljs](https://npm.io/package/shelljs.md) ~0.5.3

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2015-11-10
- 0.0.6 — 2015-11-09
- 0.0.5 — 2015-10-21
- 0.0.4 — 2015-10-21
- 0.0.3 — 2015-10-19
- 0.0.2 — 2015-10-19
- 0.0.1 — 2015-10-18

## README

## c-watch

[![Build Status](https://travis-ci.org/William-Olson/c-watch.svg?branch=master)](https://travis-ci.org/William-Olson/c-watch)

A simple watcher program for C/C++ projects.  Automatically
runs make and executes the c program when src files are changed.

### Install

```
npm install -g c-watch
```

### Try

display help:

```
c-watch -h
```

this should output something like this:

```
 Available options:
  -s, --source="..."        ex. -s "./*, ./src/*"  #comma delimitted
  -g, --gcc="..."      [!]  ex. -g "-O3 --Wall"    #space delimitted
  -o, --out="..."           ex. -o "foo.out"
  -p, --params="..."        ex. -p "inFile.txt 25"
  -m, --make="..."          ex. -m "target"
  -h, --help                displays this menu

    [!] = Unsupported at this time.

```

**run with defaults**:

```
c-watch
```

c-watch will look in the current directory for a Makefile and watches
any files with .c, .cpp or .h extensions in the current directory. It tries
to run an executable named a.out.

### Common options

**Makefile**

If your makefile is in a different location than the current directory, then
you can explicitly provide it with the source flag (-s).

```
c-watch -s "some-dir/Makefile,src/*.c,src/*.h"
```

**Build**

Specify to only build a certain item in the makefile:

```
c-watch -s "some-dir/Makefile,src/*.c,src/*.h" --make="target_two"
```

The above will run `make target_two` instead of just `make` by itself.  Specify
multiple targets if you want (delimited by spaces).

**Executable**

You will most likely want to specify where the executable is that your makefile built.
This can be done with the output flag (-o) indicating c-watch should run that file.

```
c-watch -o ./bin/a.out
```

**Parameters**

Pass some args to your c executable.

```
c-watch -p "input-file.txt 9000.1 0xFF -v ..etc."
```

**gotcha**: avoid using redirection for output in the param field.  You can redirect the whole
output with redirection outside of the param field.

```
#append output to output-file.txt
c-watch -p "input-file.txt" >> output-file.txt
```

---
_Source: https://npm.io/package/c-watch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
