This commit is contained in:
2025-11-05 09:36:35 -05:00
parent adedeb5b63
commit a977f0afbe

View File

@@ -26,6 +26,10 @@
#include "version.h" #include "version.h"
#include <template.h> #include <template.h>
#ifndef GOOD
#define GOOD 0
#endif
typedef enum { MIT, GPL, BSD, UNL } license_t; typedef enum { MIT, GPL, BSD, UNL } license_t;
static const struct option longopts[] = { static const struct option longopts[] = {
@@ -96,11 +100,12 @@ int main(int argc, char **argv)
{ {
int optc; int optc;
int lose = 0; int lose = 0;
char *m = str_dup("Does a thing"), *package; char *m = str_dup("[DESCRIPTION]"), /* description flag */
bool shell = false; *package;
bool flat = false; bool S = false; /* shell flag */
bool f = false; /* flat flag */
char *author = get_name(); char *author = get_name();
exit_status = EXIT_SUCCESS; exit_status = GOOD;
int year = get_year(); int year = get_year();
license_t license = BSD; license_t license = BSD;
char *license_str = "BSD-3-Clause"; char *license_str = "BSD-3-Clause";
@@ -148,10 +153,10 @@ int main(int argc, char **argv)
} }
break; break;
case 'S': case 'S':
shell = true; S = true;
break; break;
case 'f': case 'f':
flat = true; f = true;
break; break;
default: default:
lose = 1; lose = 1;
@@ -171,7 +176,7 @@ int main(int argc, char **argv)
package = str_dup(argv[optind]); package = str_dup(argv[optind]);
if (shell) if (S)
return write_shell(package, license_str, year, author, m); return write_shell(package, license_str, year, author, m);
char *project_dir; char *project_dir;
@@ -199,7 +204,7 @@ int main(int argc, char **argv)
fs_write("README", templ_README, author, package, package, m, year, fs_write("README", templ_README, author, package, package, m, year,
package, author, package); package, author, package);
if (flat) if (f)
exit_status = exit_status =
generate_flat(package, author, year, license_str, m); generate_flat(package, author, year, license_str, m);
// else // else