github.com/suntong/easygen@v5.3.0+incompatible/cmd/easygen/easygen.yaml (about) 1 # program name, name for the executable 2 ProgramName: easygen 3 4 # package name 5 # - For standalone program that does not belong to any package, e.g., 6 # https://github.com/suntong/easygen/blob/7791e4f0e5605543d27da1671a21376cdb9dcf2a/easygen/easygen.go 7 # just ignore the first line, the `package` output, and copy the rest 8 # - If you don't mind using a separated file to handle commandline paramters, 9 # then name the package as "main". see the spin-out "TF-minus1.go" file under 10 # https://github.com/suntong/easygen/tree/d1ab0b5fe80ddac57fe9ef51f6ccb3ab998cd5ee 11 # - If you are using it in a pacakge, look no further than 12 # https://github.com/suntong/easygen/blob/master/easygenapi/config.go 13 # which was a direct dump: easygen test/commandlineFlag | gofmt > easygenapi/config.go 14 # 15 PackageName: easygen 16 17 # Name of the structure to hold the values for/from commandline 18 StructName: Options 19 # The actual variable that hold the commandline paramter values 20 StructVar: Opts 21 22 Options: 23 24 - Name: TemplateStr 25 Type: string 26 Flag: ts 27 Value: '""' 28 Usage: "template string (in text)" 29 30 - Name: ExtYaml 31 Type: string 32 Flag: ey 33 Value: '".yaml"' 34 Usage: "`extension` of yaml file" 35 36 - Name: ExtJson 37 Type: string 38 Flag: ej 39 Value: '".json"' 40 Usage: "`extension` of json file" 41 42 - Name: ExtTmpl 43 Type: string 44 Flag: et 45 Value: '".tmpl"' 46 Usage: "`extension` of template file" 47 48 - Name: Debug 49 Type: int 50 Flag: debug 51 Value: 0 52 Usage: "debugging `level`" 53 54 # Whether to use the USAGE_SUMMARY in Usage help 55 UsageSummary: "" 56 57 UsageLead: "\\nUsage:\\n %s [flags] template_name [data_filename [data_filename...]]\\n\\nFlags:\\n\\n" 58 59 UsageEnd: | 60 61 template_name: The name for the template file. 62 - Can have the extension (specified by -et) or without it. 63 - Can include the path as well. 64 - Can be a comma-separated list giving many template files, in which case 65 at least one data_filename must be given. 66 67 data_filename(s): The name for the .yaml or .json data. 68 - If omitted derive from the template_name. 69 - Can have the extension or without it. If withot extension, 70 will try the .yaml file first then .json 71 - Can include the path as well. 72 - Can have more than one data files given on cli, separated by spaces, 73 in which case multiple outputs will be produced based on the inputs. 74 - Can be a comma-separated list giving many data files, in which case 75 data will be merged together as if provided from a single file. 76 - If there is a single data_filename, and it is "-", 77 then read the data (.yaml or .json format) from stdin. 78 79 Flag defaults can be overridden by corresponding environment variable, e.g.: 80 EASYGEN_EY=.yml EASYGEN_ET=.tpl easygen ... 81