]> git repos ~mattia - run_at_change.git/commitdiff
Copyright, man(1) page and C standard main
authorMattia Cabrini <dev@mattiacabrini.com>
Sun, 14 Apr 2024 20:10:20 +0000 (22:10 +0200)
committerMattia Cabrini <dev@mattiacabrini.com>
Sun, 14 Apr 2024 20:10:20 +0000 (22:10 +0200)
LICENSE
Makefile
main.c
man.1 [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
index 278bf201c6554fc5211171e4ce9d4d19313d67d1..f0d773431a374f7eec87b661f082d2424efd0d0a 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2023 Mattia Cabrini
+Copyright (c) 2024 Mattia Cabrini
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
index 3eb5bee9db84eb5b5e36ca25c0c4ab5bae1446c8..2ba85ae1fd123b77adbf91f4a16e714fc0c331c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,11 @@
 build: clear 
-       gcc -lc main.c -o main
+       gcc -std=gnu90 -lc main.c -o rac
 
 debug: clear
-       gcc -lc main.c -g -o main
+       gcc -std=gnu90 -lc main.c -g -o rac
 
 clear:
-       rm -f main
+       rm -f rac
 
 all: build
 
-run: build
-       ./main --path main.c --comm "cat main.c"
-
-run-debug: debug
-       gdb ./main --path main.c --comm "cat main.c"
diff --git a/main.c b/main.c
index fb014c3fbb9eed76c869a8b6bc7f330b5ef34f42..fdf535d6d7ace8ab75631e387f5d062ca694ff2d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,7 +1,7 @@
 /*
 MIT License
 
-Copyright (c) 2023 Mattia Cabrini
+Copyright (c) 2024 Mattia Cabrini
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/man.1 b/man.1
new file mode 100644 (file)
index 0000000..6096eda
--- /dev/null
+++ b/man.1
@@ -0,0 +1,59 @@
+NAME
+    Run@Change
+
+SYNOPSIS
+    rac <FLAG> <VALUE> [<FLAG> <VALUE> ...]
+
+DESCRIPTION
+    Run@Change will watch a file and will run a command whenever the file is changed.
+
+FLAGS
+    --path or -p   Should be used to set the path to the file.
+
+    --comm or -c   Should be used to set the command.
+                   Any argument provided after this flag will be considered
+                   part of the command to execute when the file is changed.
+
+EXAMPLES
+    rac --path main.c --comm cat main.c
+
+    Anytime the file main.c is changed, `cat main.c` will be executed.
+
+    It is equivalent to:
+
+    rac -p main.c --comm cat main.c
+
+    or 
+
+    rac -p main.c -c cat main.c
+
+SEE ALSO
+    inotify(7)
+
+BUGS
+
+AUTHOR
+    Mattia Cabrini <dev@mattiacabrini.com>
+
+COPYRIGHT
+    MIT License
+    
+    Copyright (c) 2024 Mattia Cabrini
+    
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+    
+    The above copyright notice and this permission notice shall be included in all
+    copies or substantial portions of the Software.
+    
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+    SOFTWARE.