remove manual and add help message in readme and program

This commit is contained in:
Night Kaly 2024-05-21 14:38:38 +00:00
parent f64fcb259d
commit ada89a098a
4 changed files with 7 additions and 25 deletions

View file

@ -4,10 +4,8 @@
CC = cc
VERSION = 1.0
TARGET = lcc
MANPAGE = $(TARGET).1
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
# Flags
CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
@ -19,7 +17,7 @@ $(TARGET): $(SRC)
dist:
mkdir -p $(TARGET)-$(VERSION)
cp -R README.md $(MANPAGE) $(TARGET) $(TARGET)-$(VERSION)
cp -R README.md $(TARGET) $(TARGET)-$(VERSION)
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
gzip $(TARGET)-$(VERSION).tar
rm -rf $(TARGET)-$(VERSION)
@ -29,12 +27,9 @@ install: $(TARGET)
mkdir -p $(DESTDIR)$(MANDIR)
cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET)
cp -p $(MANPAGE) $(DESTDIR)$(MANDIR)/$(MANPAGE)
chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
$(RM) $(DESTDIR)$(MANDIR)/$(MANPAGE)
clean:
$(RM) $(TARGET)

View file

@ -1,10 +1,10 @@
# lcc
Lines of Code Counter
Fast lines of code counter.
# Usage
```sh
lcc <path> <path2> <path3> ...
lcc <path> <path2> <path3> - Count lines of code in supplied paths(no argument would be considered counting in current directory)
```
# Dependencies

17
lcc.1
View file

@ -1,17 +0,0 @@
.TH lcc 1 lcc\-1.0.0
.SH NAME
lcc \- Lines of Code Counter
.SH SYNOPSIS
.B lcc
.SH DESCRIPTION
lcc is a fast and lightweight source lines of code counter.
.SH OPTIONS
.TP
.B apm <path> <path2> <path3>
Count lines of code in the supplied paths.
.SH AUTHOR
Made by Night Kaly
.B <night@night0721.xyz>

4
lcc.c
View file

@ -134,6 +134,10 @@ int compare_stats(const void *a, const void *b) {
int main(int argc, char **argv)
{
if (argc == 2 && strncmp(argv[1], "-h", 2) == 0) {
fprintf(stderr, "lcc - Lines of Code Counter\n\nUsage: lcc <path> <path2> <path3> - Count lines of code in supplied paths(no argument would be considered counting in current directory)\n");
return 0;
}
for (size_t i = 0; i < NUM_LANGS; i++) {
stats[i].name = languages[i].name;
}