20 cd "$proj" && git init
> /dev
/null
21 git remote add github git@github.com
:afify
/"$proj".git
> /dev
/null
22 git remote add repo
ssh://repo.or.cz
/"$proj".git
> /dev
/null
25 #==============================================================================
26 printf "%s\\n*.db\\n*.txt\\n*.log\\n*.o\\n.gitignore" "$proj" > .
/.gitignore
29 #==============================================================================
30 echo "BSD 3-Clause License
32 Copyright (c) $year, Hassan Afify
35 Redistribution and use in source and binary forms, with or without
36 modification, are permitted provided that the following conditions are met:
38 1. Redistributions of source code must retain the above copyright notice, this
39 list of conditions and the following disclaimer.
41 2. Redistributions in binary form must reproduce the above copyright notice,
42 this list of conditions and the following disclaimer in the documentation
43 and/or other materials provided with the distribution.
45 3. Neither the name of the copyright holder nor the names of its
46 contributors may be used to endorse or promote products derived from
47 this software without specific prior written permission.
49 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"
50 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
52 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
53 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
55 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
56 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
57 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." > .
/LICENSE
61 #==============================================================================
63 # See LICENSE file for copyright and license details.
73 @echo $proj build options:
74 @echo \"CFLAGS = \${CFLAGS}\"
75 @echo \"LDFLAGS = \${LDFLAGS}\"
79 \${CC} -c \${CFLAGS} \$<
81 \${OBJ}: config.h config.mk
87 \${CC} -o \$@ \${OBJ} \${LDFLAGS}
90 rm -f $proj \${OBJ} $proj-\${VERSION}.tar.gz
93 mkdir -p $proj-\${VERSION}
94 cp -R LICENSE Makefile README.md config.def.h config.mk\\
95 $proj.1 util.h \${SRC} $proj-\${VERSION}
96 tar -cf $proj-\${VERSION}.tar $proj-\${VERSION}
97 gzip $proj-\${VERSION}.tar
98 rm -rf $proj-\${VERSION}
101 mkdir -p \${DESTDIR}\${PREFIX}/bin
102 cp -f $proj \${DESTDIR}\${PREFIX}/bin
103 chmod 755 \${DESTDIR}\${PREFIX}/bin/$proj
104 mkdir -p \${DESTDIR}\${MANPREFIX}/man1
105 sed \"s/VERSION/\${VERSION}/g\" < $proj.1 > \${DESTDIR}\${MANPREFIX}/man1/$proj.1
106 chmod 644 \${DESTDIR}\${MANPREFIX}/man1/$proj.1
109 rm -f \${DESTDIR}\${PREFIX}/bin/$proj\\
110 \${DESTDIR}\${MANPREFIX}/man1/$proj.1
112 .PHONY: all options clean dist install uninstall"> .
/Makefile
115 #==============================================================================
118 [![Language grade: C/C++]()]()
119 [![Build status]()]()
122 $proj is a simple {description} for unix-like systems, follows
123 the suckless [philosophy](https://suckless.org/philosophy/) and
124 [code style](https://suckless.org/coding_style/).
128 git clone https://github.com/afify/$proj.git
135 wget --content-disposition \$(curl -s https://api.github.com/repos/afify/$proj/releases/latest | tr -d '\",' | awk '/tag_name/ {print \"https://github.com/afify/$proj/archive/\"\$2\".tar.gz\"}')
136 tar -xzf $proj-*.tar.gz && cd $proj-*/
151 | option | description |
152 |:------:|:---------------------------------------------|
153 | \`-v\` | print version. |
157 The configuration of $proj is done by creating a custom config.h
158 and (re)compiling the source code." > .
/README.md
161 #==============================================================================
162 printf "/* See LICENSE file for copyright and license details.*/\\n
163 #ifndef CONFIG_H\\n#define CONFIG_H\\n\\n\\n\\n#endif /* CONFIG_H */\\n"> .
/config.def.h
166 #==============================================================================
170 # Customize below to fit your system
174 MANPREFIX = \${PREFIX}/share/man
178 WARN = -pedantic -Wextra -Wall
182 CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\\\\\"\${VERSION}\\\\\"
183 CFLAGS = \${STD} \${WARN} -Os \${CPPFLAGS}
186 # compiler and linker
187 CC = cc" "$proj" > .
/config.mk
190 #==============================================================================
191 echo ".TH $proj 1 $proj\-VERSION
211 $proj is customized by creating a custom config.h and (re)compiling the source
212 code. This keeps it fast, secure and simple.
214 Hassan Afify <hassan at afify dot dev>"> .
/"$proj".1
217 #==============================================================================
218 printf "/* See LICENSE file for copyright and license details. */
222 #include \"config.h\"
227 /* function declarations */
228 static void usage(void);
230 /* global variables */
232 /* function implementations */
236 die(\"usage: %s -[Aacv]\\\noptions:\\\n \\\\
237 -A print all tasks, 12-hour clock format.\\\n \\\\
238 -a print all tasks.\\\n \\\\
239 -N print all upcoming tasks, 12-hour clock format.\\\n \\\\
240 -n print all upcoming tasks.\\\n \\\\
241 -c use cache file.\\\n \\\\
242 -v print version.\");
246 main(int argc, char *argv[])
250 }\\n" "$proj" > .
/"$proj".c
253 #==============================================================================
254 printf "/* See LICENSE file for copyright and license details. */
263 ecalloc(size_t nmemb, size_t size)
266 p = calloc(nmemb, size);
267 FAIL_IF(p == NULL, \"calloc\");
272 die(const char *fmt, ...)
277 (void)vfprintf(stderr, fmt, ap);
280 if (fmt[0] != '\\\0' && fmt[strlen(fmt)-1] == ':') {
281 (void)fputc(' ', stderr);
284 (void)fputc('\\\n', stderr);
291 #==============================================================================
292 printf "/* See LICENSE file for copyright and license details. */
297 #define MAX(A, B) ((A) > (B) ? (A) : (B))
298 #define MIN(A, B) ((A) < (B) ? (A) : (B))
299 #define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
300 #define FAIL_IF(EXP, MSG) {if(EXP){fprintf(stderr, \"[\\\033[31mFAILED \\%d\\\033[0m] \\%s\\\n\", __LINE__, MSG);exit(EXIT_FAILURE);}}
302 void *ecalloc(size_t, size_t);
303 void die(const char *fmt, ...);
305 #endif /* UTIL_H */\\n">.
/util.h
308 #==============================================================================
310 - [ ] edit documentation
330 ### linting, code style
341 ### Next version ideas" > .
/todo.txt