Skip to content

Commit

Permalink
Fix up install and provide --help text
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevault committed Apr 17, 2014
1 parent c967c14 commit 4459a12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_executable(genkfs
main.c
)

install(PROGRAMS genkfs
install(PROGRAMS bin/genkfs
DESTINATION bin)

set(CMAKE_BUILD_TYPE Release)
11 changes: 8 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ struct {
FILE *rom;
} context;

void show_help() {
printf("Usage: genkfs <rom file> <model directory>\n");
}

void parse_context(int argc, char **argv) {
context.rom_file = context.model_dir = NULL;
const char *errorMessage = "Invalid usage - see `genkfs --help` or `man 1 genkfs` for more info.";
const char *errorMessage = "Invalid usage - see `genkfs --help`";
int i;
for (i = 1; i < argc; i++) {
if (*argv[i] == '-') {
if (strcasecmp(argv[i], "--help")) {
// TODO
if (strcasecmp(argv[i], "--help") == 0) {
show_help();
exit(0);
} else {
fprintf(stderr, errorMessage);
exit(1);
Expand Down

0 comments on commit 4459a12

Please sign in to comment.