You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

c-watch

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c-watch

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

0.0.7
latest
Source
npm
Version published
Weekly downloads
2
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

c-watch

Build Status

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

Keywords

gulp

FAQs

Package last updated on 10 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts