commit 33c340749c5728136461b898a74478be5b148b6a Author: vx-clutch Date: Fri Mar 27 15:38:41 2026 -0400 first commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8990af7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2026 vxc + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..973f61f --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +include config.mk + +OBJ = src/frcctrlmgr.o +BIN = frcctrlmgr + +all: $(BIN) + +$(BIN): $(OBJ) + $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) + +install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) + rm -f $(DESTDIR)$(MANPREFIX)/man8/$(BIN).8 + +dist: clean + mkdir -p frcctrlmgr-$(VERSION) + cp LICENSE Makefile README config.mk src/frcctrlmgr.c src/frcctrlmgr.h frcctrlmgr-$(VERSION) + tar -cf frcctrlmgr-$(VERSION).tar frcctrlmgr-$(VERSION) + gzip frcctrlmgr-$(VERSION).tar + rm -rf frcctrlmgr-$(VERSION) + +clean: + rm -f $(BIN) $(OBJ) frcctrlmgr-$(VERSION).tar.gz + +.PHONY: + all install uninstall dist clean diff --git a/README b/README new file mode 100644 index 0000000..68412f4 --- /dev/null +++ b/README @@ -0,0 +1,23 @@ +frcctrlmgr - FRC Control Manager +================================ + +frcctrlmgr is a fast and simple tool for generating reference documents of your +control scheme. + +Why? +---- + +I wanted to have an easy way to visualize the controls. + +How? +---- + +The main way to use this is to invoke in the shell with the root of the +project. i.e. + + frcctrlmgr . + frcctrlmgr path/to/project/ + +This is tested on the Adambots 2026 repository. + +[1] https://github.com/Adambots245/Adambots2026 diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..63eb805 --- /dev/null +++ b/config.mk @@ -0,0 +1,12 @@ +# frcctrlmgr version +VERSION = 0.1 + +# paths +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/share/man + +CC = cc +LD = $(CC) +CPPFLAGS = +CFLAGS = -Wextra -Wall -Os +LDFLAGS = -s diff --git a/frcctrlmgr b/frcctrlmgr new file mode 100755 index 0000000..5998288 Binary files /dev/null and b/frcctrlmgr differ diff --git a/src/frcctrlmgr.c b/src/frcctrlmgr.c new file mode 100644 index 0000000..503cea1 --- /dev/null +++ b/src/frcctrlmgr.c @@ -0,0 +1,22 @@ +#include "frcctrlmgr.h" + +char *argv0; + +void usage(int code) { + printf("usage: %s: [-h help] [-v]\n", argv0); + exit(code); +} + +int main(int argc, char *argv[]) { + argv0 = argv[0]; + + for (int i = 0; i < argc; ++i) { + if (STRCMP("--help")) + usage(0); + if (STRCMP("-h")) + usage(0); + if (STRCMP("-v")) + printf("%s/%s\n", argv0, VERSION); + } + return 0; +} diff --git a/src/frcctrlmgr.h b/src/frcctrlmgr.h new file mode 100644 index 0000000..7ed9b08 --- /dev/null +++ b/src/frcctrlmgr.h @@ -0,0 +1,11 @@ +#ifndef FRCCTRLMGR_H_ +#define FRCCTRLMGR_H_ + +#define VERSION "0.1" + +#include +#include + +#define STRCMP(x) !strcmp(argv[i], x) + +#endif // FRCTRLMGR_H_ diff --git a/src/frcctrlmgr.o b/src/frcctrlmgr.o new file mode 100644 index 0000000..d5c0a94 Binary files /dev/null and b/src/frcctrlmgr.o differ