diff --git a/TODO b/TODO index 85f853a..ae4e92c 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,6 @@ Todo: * Polish for 1.0 * Implement the extra options * Document the extra options - * Update usage text to work with help2man * Add build target for man. * Refactor to more GNU style main * Look into conf file diff --git a/src/main.c b/src/main.c index c104635..40aee22 100644 --- a/src/main.c +++ b/src/main.c @@ -33,25 +33,29 @@ static void usage(int status) return; } - puts("Usage: yait [OPTION]... "); - puts("Creates a C project with opinionated defaults"); - puts("When only given the first argument it will detect your name\n"); - puts("Mandatory arguments to long options are mandatory for short options too"); - print_option("--git", "Initialize git repository (default)"); - print_option("--no-git", "Do not initialize git repository"); - print_option("--lib", "Make this a library"); - print_option("-l ", - "Set licence. This list can be found by passing 'list'"); - print_option("-E", "Open $EDITOR after project creation"); - print_option("--autotools", "Use the autotools build system"); - print_option("--cmake", "Use the cmake build system"); - print_option("--make", "Use the GNU make build system (default)"); - print_option("--bare", "Minimal C project structure"); - print_option("--flat", "All files in project root."); - print_option("--extras=,", - "Extra build options, Pass list to list out options."); - puts(" --help display this help text and exit"); - puts(" --version output version information and exit"); + printf("Usage: %s [OPTION]... [project-name]\n", PROGRAM); + fputs("\ +Generates an optionated C project.\n", + stdout); + puts(""); + fputs("\ + --help display this help and exit\n\ + --version display version information and eixt\n", + stdout); + puts(""); + fputs("\ + --git Initialize git repository (default)\n\ + --no-git Do not initialize git repository\n\ + --lib Make this a library\n\ + -l Set licence. This list can be found by passing 'list'\n\ + -E Open $EDITOR after project creation\n\ + --autotools Use the autotools build system\n\ + --cmake Use the cmake build system\n\ + --make Use the GNU make build system (default)\n\ + --bare Minimal C project structure\n\ + --flat All files in project root.\n\ + --extras=, Extra build options, Pass list to list out options.\n", + stdout); } void print_lines(const char *first, ...) diff --git a/yait.1 b/yait.1 new file mode 100644 index 0000000..4b851b7 --- /dev/null +++ b/yait.1 @@ -0,0 +1,66 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. +.TH YAIT "1" "September 2025" "yait beta 156" "User Commands" +.SH NAME +yait \- manual page for yait beta 156 +.SH SYNOPSIS +.B yait +[\fI\,OPTION\/\fR]... [\fI\,project-name\/\fR] +.SH DESCRIPTION +Generates an optionated C project. +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +display version information and eixt +.TP +\fB\-\-git\fR +Initialize git repository (default) +.TP +\fB\-\-no\-git\fR +Do not initialize git repository +.TP +\fB\-\-lib\fR +Make this a library +.TP +\fB\-l\fR +Set licence. This list can be found by passing 'list' +.TP +\fB\-E\fR +Open $EDITOR after project creation +.TP +\fB\-\-autotools\fR +Use the autotools build system +.TP +\fB\-\-cmake\fR +Use the cmake build system +.TP +\fB\-\-make\fR +Use the GNU make build system (default) +.TP +\fB\-\-bare\fR +Minimal C project structure +.TP +\fB\-\-flat\fR +All files in project root. +.TP +\fB\-\-extras=\fR, +Extra build options, Pass list to list out options. +.SH COPYRIGHT +Copyright \(co 2025 GCK. +License BSD\-3\-Clause: BSD\-3\-Clause +.br +This is free software: you are free to change and redistribute it. +There is NO WARRNTY, to the extent permitted by law. +.SH "SEE ALSO" +The full documentation for +.B yait +is maintained as a Texinfo manual. If the +.B info +and +.B yait +programs are properly installed at your site, the command +.IP +.B info yait +.PP +should give you access to the complete manual.