#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void parse_flags(int argc, char **argv, char *out) {
	char flags[64];
	int c = 0;
	for(int i = 1; i < argc; i++) {
		if(argv[i][0] == '-') {
			for(int j = 1; j < strlen(argv[i]); j++) {
				bool found = 0;
				int k = 0;
				for(; k < c; k++) {	//check for duplicates
					if(flags[k] == argv[i][j]) {
						found = 1;
						break;
					}
				}
			if(!found) {flags[k] = argv[i][j]; c++;}
			}
		}
	}
	for(int i = 0; i < 64; i++) {
		out[i] = flags[i];	//copy to external string
	}
}
int main(int argc, char **argv) {
	char flag[64];
	parse_flags(argc, argv, flag);	//usage: pass in argument count, table of arguments(argv), and a 64 byte long string to write into
	printf(flag);	//this is just for a test, the function doesnt append a null byte
}
