.TH REFLEX 1 "October 29, 2018" "version 0.2.0+git20181022.3df204f" "USER COMMANDS" .SH NAME Reflex \- Run a command when files change .SH SYNOPSIS .B reflex [OPTIONS] [COMMAND] .SH DESCRIPTION Reflex is a small tool to watch a directory and rerun a command when certain files change. It's great for automatically running compile/lint/test tasks and for reloading your application when the code changes. .SH OPTIONS .TP .BR \-\-all=\fITrue|False\fR Include normally ignored files (VCS and editor special files). Defaults to False. .TP .BR \-c ", " \-\-config=\fIFILE\fR A configuration file that describes how to run reflex (or '\-' to read the configuration from stdin). .TP .BR \-d ", " \-\-decoration=\fIDECORATION\fR How to decorate command output. Choices: none, plain, fancy. Default is plain. .TP .BR \-g ", " \-\-glob=\fIGLOB_LIST\fR A shell glob expression to match filenames. (May be repeated.) .TP .BR \-G ", " \-\-inverse\-glob=\fIGLOB_LIST\fR A shell glob expression to exclude matching filenames. (May be repeated.) .TP .BR \-R ", " \-\-inverse\-regex=\fIREGEX\fR A regular expression to exclude matching filenames. (May be repeated.) .TP .BR \-\-only\-dirs=\fITrue|False\fR Only match directories (not files). Defaults to false. .TP .BR \-\-only\-files=\fITrue|False\fR Only match files (not directories). Defaults to false. .TP .BR \-r ", " \-\-regex=\fIREGEX\fR A regular expression to match filenames. (May be repeated.) .TP .BR \-e ", " \-\-sequential=\fITrue|False\fR Don't run multiple commands at the same time. Defaults to false. .TP .BR \-t ", " \-\-shutdown\-timeout=\fITIMEOUT\fR Allow services this long to shut down. Defaults to 500ms. .TP .BR \-s ", " \-\-start\-service=\fITrue|False\fR Indicates that the command is a long-running process to be restarted on matching changes. Defaults to false. .TP .BR \-\-substitute=\fISTRING\fR The substitution symbol that is replaced with the filename in a command. Defaults to "{}" .TP .BR \-v ", " \-\-verbose=\fITrue|False\fR Verbose mode: print out more information about what reflex is doing. Defaults to false. .SH EXAMPLES Print each .txt file if it changes: .PP .nf .RS reflex -r '\\.txt$' echo {} .RE .fi .PP Run .BR make (1) if any of the .c files in this directory change: .PP .nf .RS reflex -g '*.c' make .RE .fi .PP Build and run a server; rebuild and restart when .java files change: .PP .nf .RS reflex -r '\\.java$' -s -- sh -c 'make && java bin/Server' .RE .fi .PP