11package components
2+
23import " strings"
34
45type FeatureTuple struct {
@@ -7,24 +8,42 @@ type FeatureTuple struct {
78}
89
910func GetCommandString (options OptionsStruct ) string {
11+ var command string
12+
1013 projectName := strings.ReplaceAll (options.ProjectName , " " , " _" )
1114 if projectName == " " {
1215 projectName = " my_project"
1316 }
14- command := " go-blueprint create --name " + projectName + " --framework " + options.SelectedBackend
15- if options.SelectedDB != " none" {
16- command += " --driver " + options.SelectedDB
17- } else {
18- command += " --driver none"
19- }
20- if len (options.AdvancedOptions ) > 0 {
21- command += " --advanced"
22- }
23- for _ , opt := range options.AdvancedOptions {
24- command += " --feature " + opt
25- }
17+ if options.ShortFlags { // Short format when toggle is checked
18+ command = " go-blueprint create -n " + projectName + " -f " + options.SelectedBackend
19+ if options.SelectedDB != " none" {
20+ command += " -d " + options.SelectedDB
21+ } else {
22+ command += " -d none"
23+ }
24+ if len (options.AdvancedOptions ) > 0 {
25+ command += " -a"
26+ }
27+ for _ , opt := range options.AdvancedOptions {
28+ command += " --feature " + opt
29+ }
30+ command += " -g " + options.SelectGit
2631
27- command += " --git " + options.SelectGit
32+ } else { // Long format (default)
33+ command = " go-blueprint create --name " + projectName + " --framework " + options.SelectedBackend
34+ if options.SelectedDB != " none" {
35+ command += " --driver " + options.SelectedDB
36+ } else {
37+ command += " --driver none"
38+ }
39+ if len (options.AdvancedOptions ) > 0 {
40+ command += " --advanced"
41+ }
42+ for _ , opt := range options.AdvancedOptions {
43+ command += " --feature " + opt
44+ }
45+ command += " --git " + options.SelectGit
46+ }
2847
2948 return command
3049}
@@ -71,6 +90,20 @@ var options = OptionsStruct{
7190
7291templ Form () {
7392 <form class =" space-y-2" hx-boost =" true" action =" /update_structure" hx-trigger =" submit" hx-target =" #results" >
93+ <div class =" flex justify-end mb-4" >
94+ <label class =" inline-flex items-center cursor-pointer" >
95+ <input
96+ type =" checkbox"
97+ id =" shortFlags"
98+ name =" shortFlags"
99+ class =" sr-only peer"
100+ hx-post =" /update_structure"
101+ hx-target =" #results"
102+ />
103+ <div class =" relative w-11 h-6 bg-gray-300 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-indigo-600" ></div >
104+ <span class =" ms-3 text-sm font-medium text-gray-900" >Short CLI Flags</span >
105+ </label >
106+ </div >
74107 <div class =" mt-4" >
75108 <label
76109 for =" projectName"
0 commit comments