From: Mattia Cabrini Date: Sun, 14 Apr 2024 20:10:20 +0000 (+0200) Subject: Copyright, man(1) page and C standard X-Git-Url: https://git.theboydaily.dev/mattia?a=commitdiff_plain;h=adad7c9515e108625d55abd36d44c87407ab09d0;p=run_at_change.git Copyright, man(1) page and C standard --- diff --git a/LICENSE b/LICENSE index 278bf20..f0d7734 100644 --- 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 diff --git a/Makefile b/Makefile index 3eb5bee..2ba85ae 100644 --- 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 fb014c3..fdf535d 100644 --- 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 index 0000000..6096eda --- /dev/null +++ b/man.1 @@ -0,0 +1,59 @@ +NAME + Run@Change + +SYNOPSIS + rac [ ...] + +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 + +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.