@@ -123,6 +123,46 @@ namespace vix::commands
123123 {
124124 opt.header_only = true ;
125125 }
126+ else if (a == " --server" )
127+ {
128+ opt.config_options .with_server = true ;
129+ }
130+ else if (a == " --no-server" )
131+ {
132+ opt.config_options .with_server = false ;
133+ }
134+ else if (a == " --logging" )
135+ {
136+ opt.config_options .with_logging = true ;
137+ }
138+ else if (a == " --no-logging" )
139+ {
140+ opt.config_options .with_logging = false ;
141+ }
142+ else if (a == " --waf" )
143+ {
144+ opt.config_options .with_waf = true ;
145+ }
146+ else if (a == " --no-waf" )
147+ {
148+ opt.config_options .with_waf = false ;
149+ }
150+ else if (a == " --websocket" )
151+ {
152+ opt.config_options .with_websocket = true ;
153+ }
154+ else if (a == " --no-websocket" )
155+ {
156+ opt.config_options .with_websocket = false ;
157+ }
158+ else if (a == " --database" )
159+ {
160+ opt.config_options .with_database = true ;
161+ }
162+ else if (a == " --no-database" )
163+ {
164+ opt.config_options .with_database = false ;
165+ }
126166 else if (a == " -d" || a == " --dir" )
127167 {
128168 if (i + 1 < args.size () && !is_option_token (args[i + 1 ]))
@@ -458,6 +498,59 @@ namespace vix::commands
458498 return run_direct (opt);
459499 }
460500
501+ int run_config_prompt (mk::MakeOptions opt)
502+ {
503+ if (opt.name .empty ())
504+ {
505+ while (true )
506+ {
507+ opt.name = prompt_line (" Config name: " );
508+
509+ if (opt.name .empty ())
510+ {
511+ ui::warn_line (std::cout, " Config name is required." );
512+ continue ;
513+ }
514+
515+ if (!mk::is_valid_cpp_identifier (opt.name ))
516+ {
517+ ui::warn_line (std::cout, " Invalid config name." );
518+ continue ;
519+ }
520+
521+ if (mk::is_reserved_cpp_keyword (opt.name ))
522+ {
523+ ui::warn_line (std::cout, " Reserved C++ keyword is not allowed." );
524+ continue ;
525+ }
526+
527+ break ;
528+ }
529+ }
530+
531+ opt.config_options .with_server =
532+ prompt_yes_no (" Include server section?" , opt.config_options .with_server );
533+
534+ opt.config_options .with_logging =
535+ prompt_yes_no (" Include logging section?" , opt.config_options .with_logging );
536+
537+ opt.config_options .with_waf =
538+ prompt_yes_no (" Include waf section?" , opt.config_options .with_waf );
539+
540+ opt.config_options .with_websocket =
541+ prompt_yes_no (" Include websocket section?" , opt.config_options .with_websocket );
542+
543+ opt.config_options .with_database =
544+ prompt_yes_no (" Include database section?" , opt.config_options .with_database );
545+
546+ if (opt.in .empty ())
547+ {
548+ opt.in = prompt_line (" Target folder (optional): " );
549+ }
550+
551+ return run_direct (opt);
552+ }
553+
461554 int run_interactive (mk::MakeOptions opt)
462555 {
463556 const mk::MakeKind kind = mk::parse_make_kind (opt.kind );
@@ -467,6 +560,9 @@ namespace vix::commands
467560 case mk::MakeKind::Class:
468561 return run_class_prompt (opt);
469562
563+ case mk::MakeKind::Config:
564+ return run_config_prompt (opt);
565+
470566 case mk::MakeKind::Struct:
471567 case mk::MakeKind::Enum:
472568 case mk::MakeKind::Function:
@@ -534,7 +630,8 @@ namespace vix::commands
534630 out << " concept Generate a C++20 concept (.hpp)\n " ;
535631 out << " exception Generate a std::exception derived type\n " ;
536632 out << " test Generate a GoogleTest skeleton\n " ;
537- out << " module Redirects to the modules workflow\n\n " ;
633+ out << " module Redirects to the modules workflow\n " ;
634+ out << " config Generate a JSON runtime configuration file\n\n " ;
538635
539636 out << " Options:\n " ;
540637 out << " -d, --dir <path> Project root (default: current directory)\n " ;
@@ -544,6 +641,16 @@ namespace vix::commands
544641 out << " --print Print preview/snippet without writing files\n " ;
545642 out << " --dry-run Show what would be generated without writing files\n " ;
546643 out << " --force Overwrite existing files\n " ;
644+ out << " --server Enable server section for config generation\n " ;
645+ out << " --no-server Disable server section for config generation\n " ;
646+ out << " --logging Enable logging section for config generation\n " ;
647+ out << " --no-logging Disable logging section for config generation\n " ;
648+ out << " --waf Enable waf section for config generation\n " ;
649+ out << " --no-waf Disable waf section for config generation\n " ;
650+ out << " --websocket Enable websocket section for config generation\n " ;
651+ out << " --no-websocket Disable websocket section for config generation\n " ;
652+ out << " --database Enable database section for config generation\n " ;
653+ out << " --no-database Disable database section for config generation\n " ;
547654 out << " -h, --help Show help\n\n " ;
548655
549656 out << " Examples:\n " ;
@@ -556,7 +663,10 @@ namespace vix::commands
556663 out << " vix make lambda visit_all --print\n " ;
557664 out << " vix make concept EqualityComparable\n " ;
558665 out << " vix make exception InvalidToken --in src/auth\n " ;
559- out << " vix make test AuthService\n\n " ;
666+ out << " vix make test AuthService\n " ;
667+ out << " vix make config app\n " ;
668+ out << " vix make config app --websocket --database\n " ;
669+ out << " vix make:config\n\n " ;
560670
561671 out << " Behavior:\n " ;
562672 out << " - By default, files are generated in the current directory.\n " ;
0 commit comments