bulk changes
This commit is contained in:
6
config.h
6
config.h
@@ -1,10 +1,16 @@
|
|||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
|
/* Program information */
|
||||||
#define PROGRAM "yait"
|
#define PROGRAM "yait"
|
||||||
#define LICENSE_LINE "License BSD-3-Clause: BSD-3-Clause <https://opensource.org/license/bsd-3-clause>"
|
#define LICENSE_LINE "License BSD-3-Clause: BSD-3-Clause <https://opensource.org/license/bsd-3-clause>"
|
||||||
#define AUTHORS "vx_clutch"
|
#define AUTHORS "vx_clutch"
|
||||||
#define VERSION "pre-alpha"
|
#define VERSION "pre-alpha"
|
||||||
#define YEAR 2025
|
#define YEAR 2025
|
||||||
|
|
||||||
|
/* Custom error codes */
|
||||||
|
#define HELP_REQUESTED 2
|
||||||
|
#define ERROR_MEMORY_ALLOCATION 3
|
||||||
|
#define ERROR_DIRECTORY_CREATION 4
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
36
core/file.c
36
core/file.c
@@ -1,4 +1,5 @@
|
|||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include "../config.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -6,38 +7,39 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
touch (char *path, char *format, ...)
|
create_file_with_content (char *path, char *format, ...)
|
||||||
{
|
{
|
||||||
FILE *fp = fopen (path, "w");
|
FILE *fp = fopen (path, "w");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
return 0;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
va_start (args, format);
|
|
||||||
vfprintf (fp, format, args);
|
|
||||||
va_end (args);
|
|
||||||
}
|
}
|
||||||
|
va_list args;
|
||||||
|
va_start (args, format);
|
||||||
|
vfprintf (fp, format, args);
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
dir (char *format, ...)
|
create_directory (char *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
char path[1024];
|
char path[MAX_PATH_LENGTH];
|
||||||
vsnprintf (path, sizeof (path), format, args);
|
int result = vsnprintf (path, sizeof (path), format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
if (mkdir (path, 0777) < 0)
|
/* Check if the path was truncated */
|
||||||
|
if (result >= (int)sizeof (path))
|
||||||
|
{
|
||||||
|
return ENAMETOOLONG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mkdir (path, DEFAULT_DIR_PERMISSIONS) < 0)
|
||||||
{
|
{
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
@@ -46,9 +48,9 @@ dir (char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
take (const char *dirname)
|
create_and_enter_directory (const char *dirname)
|
||||||
{
|
{
|
||||||
int err = dir ("%s", dirname);
|
int err = create_directory ("%s", dirname);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
29
core/file.h
29
core/file.h
@@ -3,9 +3,32 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int take(const char *dirname);
|
/* Constants for file operations */
|
||||||
|
#define DEFAULT_DIR_PERMISSIONS 0755
|
||||||
|
#define MAX_PATH_LENGTH 1024
|
||||||
|
|
||||||
int touch(char *, char *, ...);
|
/**
|
||||||
int dir(char *, ...);
|
* Create directory and change into it
|
||||||
|
* @param dirname Directory name to create and enter
|
||||||
|
* @return 0 on success, errno on failure
|
||||||
|
*/
|
||||||
|
int create_and_enter_directory(const char *dirname);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a file with formatted content
|
||||||
|
* @param path File path to create
|
||||||
|
* @param format Format string for file content
|
||||||
|
* @param ... Variable arguments for formatting
|
||||||
|
* @return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
int create_file_with_content(char *path, char *format, ...);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a directory with formatted path
|
||||||
|
* @param format Format string for directory path
|
||||||
|
* @param ... Variable arguments for formatting
|
||||||
|
* @return 0 on success, errno on failure
|
||||||
|
*/
|
||||||
|
int create_directory(char *format, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
printfn (char *format, ...)
|
print_error_with_prefix (char *format, ...)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
fprintf (stderr, "yait: ");
|
fprintf (stderr, "yait: ");
|
||||||
len = vfprintf (stderr, format, args);
|
len = vfprintf (stderr, format, args);
|
||||||
putchar ('\n');
|
fprintf (stderr, "\n"); /* Use stderr consistently */
|
||||||
va_end (args);
|
va_end (args);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|||||||
11
core/print.h
11
core/print.h
@@ -4,6 +4,15 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int printfn(char *, ...);
|
/**
|
||||||
|
* Print a formatted message to stderr with program prefix and newline
|
||||||
|
* @param format Format string (printf-style)
|
||||||
|
* @param ... Variable arguments for formatting
|
||||||
|
* @return Number of characters printed
|
||||||
|
*/
|
||||||
|
int print_error_with_prefix(char *format, ...);
|
||||||
|
|
||||||
|
/* Legacy function name for backward compatibility */
|
||||||
|
#define printfn print_error_with_prefix
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ parse_standard_options (void (*usage) (int), int argc, char **argv)
|
|||||||
if (strcmp (argv[i], "--help") == 0)
|
if (strcmp (argv[i], "--help") == 0)
|
||||||
{
|
{
|
||||||
usage (0);
|
usage (0);
|
||||||
exit (0);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
else if (strcmp (argv[i], "--version") == 0)
|
else if (strcmp (argv[i], "--version") == 0)
|
||||||
{
|
{
|
||||||
@@ -20,8 +20,8 @@ parse_standard_options (void (*usage) (int), int argc, char **argv)
|
|||||||
"you are free to change and redistribute it.\nThere is NO "
|
"you are free to change and redistribute it.\nThere is NO "
|
||||||
"WARRNTY, to the extent permitted by law.\n",
|
"WARRNTY, to the extent permitted by law.\n",
|
||||||
PROGRAM, VERSION, COMMIT, YEAR, AUTHORS, LICENSE_LINE);
|
PROGRAM, VERSION, COMMIT, YEAR, AUTHORS, LICENSE_LINE);
|
||||||
exit (0);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return HELP_REQUESTED;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
#ifndef STANDARD_H
|
#ifndef STANDARD_H
|
||||||
#define STANDARD_H
|
#define STANDARD_H
|
||||||
|
|
||||||
int parse_standard_options(void (*)(), int argc, char **argv);
|
/**
|
||||||
|
* Parse standard command line options (--help, --version)
|
||||||
|
* @param usage_func Function pointer to usage display function
|
||||||
|
* @param argc Argument count
|
||||||
|
* @param argv Argument vector
|
||||||
|
* @return 0 on success, 1 if help/version requested, errno on error
|
||||||
|
*/
|
||||||
|
int parse_standard_options(void (*usage_func)(), int argc, char **argv);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
#ifndef CORE_H
|
#ifndef FORMAT_H
|
||||||
#define CORE_H
|
#define FORMAT_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
/* License type enumeration */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BSD3,
|
BSD3, /* BSD 3-Clause License */
|
||||||
GPLv3,
|
GPLv3, /* GNU General Public License v3 */
|
||||||
MIT,
|
MIT, /* MIT License */
|
||||||
UNLICENCE,
|
UNLICENCE, /* Unlicense */
|
||||||
} licence_t;
|
} licence_t;
|
||||||
|
|
||||||
|
/* Library type enumeration */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RAYLIB,
|
RAYLIB, /* Raylib game library */
|
||||||
WINAPI,
|
WINAPI, /* Windows API */
|
||||||
cURL,
|
cURL, /* cURL library */
|
||||||
} lib_t;
|
} lib_t;
|
||||||
|
|
||||||
|
/* Project configuration structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool git;
|
bool git; /* Whether to initialize git repository */
|
||||||
bool clang_format;
|
bool clang_format; /* Whether to create .clang-format file */
|
||||||
licence_t licence;
|
licence_t licence; /* License type for the project */
|
||||||
char *project;
|
char *project; /* Project name */
|
||||||
char *name;
|
char *name; /* Author/creator name */
|
||||||
} format_t;
|
} format_t;
|
||||||
|
|
||||||
|
/* Default values */
|
||||||
|
#define DEFAULT_LICENSE BSD3
|
||||||
|
#define DEFAULT_GIT_INIT true
|
||||||
|
#define DEFAULT_CLANG_FORMAT true
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
142
yait/main.c
142
yait/main.c
@@ -10,12 +10,27 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int create (format_t);
|
/* Constants for program behavior */
|
||||||
|
#define DEFAULT_USER_NAME "unknown"
|
||||||
|
#define DEFAULT_PROJECT_NAME "Project"
|
||||||
|
#define DEFAULT_LICENSE BSD3
|
||||||
|
#define DEFAULT_GIT_INIT true
|
||||||
|
#define DEFAULT_CLANG_FORMAT true
|
||||||
|
|
||||||
#define print_option(left, right) \
|
/**
|
||||||
printf (" %-20s %-20s" \
|
* Create a new C project with the specified configuration
|
||||||
"\n", \
|
* @param fmt Project configuration structure
|
||||||
left, right)
|
* @return 0 on success, non-zero on failure
|
||||||
|
*/
|
||||||
|
int create_project (format_t fmt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a formatted option line for help text
|
||||||
|
* @param option The option name (left side)
|
||||||
|
* @param description The option description (right side)
|
||||||
|
*/
|
||||||
|
#define print_option(option, description) \
|
||||||
|
printf (" %-20s %-20s\n", option, description)
|
||||||
|
|
||||||
void
|
void
|
||||||
usage (int status)
|
usage (int status)
|
||||||
@@ -49,10 +64,10 @@ main (int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int status = parse_standard_options (usage, argc, argv);
|
int status = parse_standard_options (usage, argc, argv);
|
||||||
if (status && status != 1)
|
if (status && status != HELP_REQUESTED)
|
||||||
{
|
{
|
||||||
printfn ("error: %s", strerror (status));
|
printfn ("error: %s", strerror (status));
|
||||||
return 1;
|
return status;
|
||||||
}
|
}
|
||||||
format_t conf;
|
format_t conf;
|
||||||
conf.project = argv[1];
|
conf.project = argv[1];
|
||||||
@@ -61,19 +76,28 @@ main (int argc, char **argv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct passwd *pw = getpwuid (getuid ());
|
struct passwd *pw = getpwuid (getuid ());
|
||||||
conf.name = pw ? pw->pw_name : NULL;
|
if (pw && pw->pw_name)
|
||||||
|
conf.name = pw->pw_name;
|
||||||
|
else
|
||||||
|
conf.name = DEFAULT_USER_NAME;
|
||||||
}
|
}
|
||||||
conf.git = true;
|
conf.git = DEFAULT_GIT_INIT;
|
||||||
conf.clang_format = true;
|
conf.clang_format = DEFAULT_CLANG_FORMAT;
|
||||||
conf.licence = BSD3;
|
conf.licence = DEFAULT_LICENSE;
|
||||||
create (conf);
|
|
||||||
return 0;
|
int result = create_project (conf);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new C project with the specified configuration
|
||||||
|
* @param fmt Project configuration structure
|
||||||
|
* @return 0 on success, non-zero on failure
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
create (format_t fmt)
|
create_project (format_t fmt)
|
||||||
{
|
{
|
||||||
int err = take (fmt.project);
|
int err = create_and_enter_directory (fmt.project);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
printfn ("failed to create or enter directory: %s", strerror (err));
|
printfn ("failed to create or enter directory: %s", strerror (err));
|
||||||
@@ -81,7 +105,9 @@ create (format_t fmt)
|
|||||||
}
|
}
|
||||||
if (fmt.git)
|
if (fmt.git)
|
||||||
system ("git init --quiet");
|
system ("git init --quiet");
|
||||||
touch ("README",
|
if (!fmt.name)
|
||||||
|
fmt.name = DEFAULT_USER_NAME;
|
||||||
|
create_file_with_content ("README",
|
||||||
"%s ( concise description )\n\n"
|
"%s ( concise description )\n\n"
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "
|
||||||
"eiusmod tempor\n"
|
"eiusmod tempor\n"
|
||||||
@@ -94,8 +120,8 @@ create (format_t fmt)
|
|||||||
"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non "
|
"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non "
|
||||||
"proident, sunt in\n"
|
"proident, sunt in\n"
|
||||||
"culpa qui officia deserunt mollit anim id est laborum.",
|
"culpa qui officia deserunt mollit anim id est laborum.",
|
||||||
fmt.project);
|
fmt.project ? fmt.project : DEFAULT_PROJECT_NAME);
|
||||||
touch ("configure",
|
create_file_with_content ("configure",
|
||||||
"#!/bin/sh\n"
|
"#!/bin/sh\n"
|
||||||
"\n"
|
"\n"
|
||||||
"usage() {\n"
|
"usage() {\n"
|
||||||
@@ -153,30 +179,60 @@ create (format_t fmt)
|
|||||||
"printf \"LDFLAGS=%%s\\n\" \"$LDFLAGS\" >> config.mak\n"
|
"printf \"LDFLAGS=%%s\\n\" \"$LDFLAGS\" >> config.mak\n"
|
||||||
"printf \"CC=%%s\\n\" \"$CC\" >> config.mak\n"
|
"printf \"CC=%%s\\n\" \"$CC\" >> config.mak\n"
|
||||||
"printf \"done\\n\"\n");
|
"printf \"done\\n\"\n");
|
||||||
char *mkfile_name;
|
// Create a safe uppercase version of the project name for Makefile variables
|
||||||
strcpy(mkfile_name, fmt.project);
|
char *mkfile_name = strdup (fmt.project);
|
||||||
for (char *p = mkfile_name; *p; ++p) *p = toupper(*p);
|
if (!mkfile_name)
|
||||||
touch ("Makefile",
|
{
|
||||||
"prefix = /usr/bin\n\n%s_SRCS := $(wildcard yait/*.c) $(wildcard "
|
printfn ("fatal: out of memory");
|
||||||
"core/*.c)\n%s_OBJS := $(patsubst "
|
return 1;
|
||||||
"yait/%.c,c-out/obj/%.o,$(%s_SRCS))\n\n%s := "
|
}
|
||||||
"c-out/bin/yait\n\n-include config.mak\n\nifeq ($(wildcard "
|
// Convert to uppercase safely, only for ASCII characters
|
||||||
"config.mak),)\nall:\n\t@echo \"File config.mak not found, run "
|
for (char *p = mkfile_name; *p; ++p)
|
||||||
"configure\"\n\t@exit 1\nelse\n\nall: build $(%s) "
|
{
|
||||||
"$(%s_DOC)\n\nbuild:\n\tmkdir -p c-out/bin\n\tmkdir -p "
|
if (*p >= 'a' && *p <= 'z')
|
||||||
"c-out/obj\n\nc-out/obj/%.o: yait/%.c\n\t$(CC) $(CFLAGS) -c $< -o "
|
*p = *p - 'a' + 'A';
|
||||||
"$@\n\n$(%s): $(%s_OBJS)\n\t$(CC) $(CFLAGS) -DCOMMIT=$(shell git "
|
}
|
||||||
"rev-list --count --all) $^ -o $@\n\n\nendif\n\ninstall:\n\t@echo "
|
create_file_with_content ("Makefile",
|
||||||
"\"NOT IMPL\"\n\texit 1\n\nuninstall:\n\t@echo \"NOT IMPL\"\n\texit "
|
"prefix = /usr/bin\n\n"
|
||||||
"1\n\nclean:\n\trm -rf c-out\n\ndist-clean: clean\n\trm -f "
|
"%s_SRCS := $(wildcard *.c)\n"
|
||||||
"config.mak\n\n.PHONY: all clean dist-clean install uninstall build "
|
"%s_OBJS := $(patsubst %%.c,c-out/obj/%%.o,$(%s_SRCS))\n\n"
|
||||||
"format\n", mkfile_name, mkfile_name, mkfile_name, mkfile_name, mkfile_name, mkfile_name);
|
"%s := c-out/bin/%s\n\n"
|
||||||
|
"-include config.mak\n\n"
|
||||||
|
"ifeq ($(wildcard config.mak),)\n"
|
||||||
|
"all:\n"
|
||||||
|
"\t@echo \"File config.mak not found, run configure\"\n"
|
||||||
|
"\t@exit 1\n"
|
||||||
|
"else\n\n"
|
||||||
|
"all: build $(%s)\n\n"
|
||||||
|
"build:\n"
|
||||||
|
"\tmkdir -p c-out/bin\n"
|
||||||
|
"\tmkdir -p c-out/obj\n\n"
|
||||||
|
"c-out/obj/%%.o: %%.c\n"
|
||||||
|
"\t$(CC) $(CFLAGS) -c $< -o $@\n\n"
|
||||||
|
"$(%s): $(%s_OBJS)\n"
|
||||||
|
"\t$(CC) $(CFLAGS) -DCOMMIT=$(shell git rev-list --count --all "
|
||||||
|
"2>/dev/null || echo 0) $^ -o $@\n\n"
|
||||||
|
"endif\n\n"
|
||||||
|
"install:\n"
|
||||||
|
"\t@echo \"NOT IMPL\"\n"
|
||||||
|
"\texit 1\n\n"
|
||||||
|
"uninstall:\n"
|
||||||
|
"\t@echo \"NOT IMPL\"\n"
|
||||||
|
"\texit 1\n\n"
|
||||||
|
"clean:\n"
|
||||||
|
"\trm -rf c-out\n\n"
|
||||||
|
"dist-clean: clean\n"
|
||||||
|
"\trm -f config.mak\n\n"
|
||||||
|
".PHONY: all clean dist-clean install uninstall build format\n",
|
||||||
|
mkfile_name, mkfile_name, mkfile_name, mkfile_name, fmt.project,
|
||||||
|
mkfile_name, mkfile_name, mkfile_name);
|
||||||
|
free (mkfile_name);
|
||||||
if (fmt.clang_format)
|
if (fmt.clang_format)
|
||||||
touch (".clang-format", "Language: Cpp\nBasedOnStyle: GNU\n");
|
create_file_with_content (".clang-format", "Language: Cpp\nBasedOnStyle: GNU\n");
|
||||||
switch (fmt.licence)
|
switch (fmt.licence)
|
||||||
{
|
{
|
||||||
case BSD3:
|
case BSD3:
|
||||||
touch (
|
create_file_with_content (
|
||||||
"COPYING",
|
"COPYING",
|
||||||
"BSD 3-Clause License\n\nCopyright (c) %d, "
|
"BSD 3-Clause License\n\nCopyright (c) %d, "
|
||||||
"%s\n\nRedistribution and use in source and binary forms, "
|
"%s\n\nRedistribution and use in source and binary forms, "
|
||||||
@@ -184,7 +240,7 @@ create (format_t fmt)
|
|||||||
"following conditions are met:\n\n1. Redistributions of source code "
|
"following conditions are met:\n\n1. Redistributions of source code "
|
||||||
"must retain the above copyright notice, this\n list of "
|
"must retain the above copyright notice, this\n list of "
|
||||||
"conditions and the following disclaimer.\n\n2. Redistributions in "
|
"conditions and the following disclaimer.\n\n2. Redistributions in "
|
||||||
"binary form must reproduce the above copyright notice,\n this "
|
"binary form must reproduce the above copyright notice,\n this\n"
|
||||||
"list of conditions and the following disclaimer in the "
|
"list of conditions and the following disclaimer in the "
|
||||||
"documentation\n and/or other materials provided with the "
|
"documentation\n and/or other materials provided with the "
|
||||||
"distribution.\n\n3. Neither the name of the copyright holder nor "
|
"distribution.\n\n3. Neither the name of the copyright holder nor "
|
||||||
@@ -205,13 +261,15 @@ create (format_t fmt)
|
|||||||
"POSSIBILITY OF SUCH DAMAGE.\n",
|
"POSSIBILITY OF SUCH DAMAGE.\n",
|
||||||
YEAR, fmt.name);
|
YEAR, fmt.name);
|
||||||
break;
|
break;
|
||||||
|
case GPLv3:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
take (fmt.project);
|
create_and_enter_directory (fmt.project);
|
||||||
touch ("main.c",
|
create_file_with_content ("main.c",
|
||||||
"#include <stdio.h>\n\nint main(void) {\n printf(\"%s: Hello "
|
"#include <stdio.h>\n\nint main(void) {\n printf(\"%s: Hello "
|
||||||
"%s!\\n\");\nreturn 0;\n}",
|
"%s!\\n\");\nreturn 0;\n}",
|
||||||
fmt.project, fmt.name);
|
fmt.project ? fmt.project : DEFAULT_PROJECT_NAME,
|
||||||
|
fmt.name ? fmt.name : "World");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user