File: commandlineEnv.tmpl

package info (click to toggle)
easygen 5.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 848 kB
  • sloc: sh: 14; makefile: 13
file content (39 lines) | stat: -rw-r--r-- 894 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package {{$.PackageName}}

// import "github.com/caarlos0/env"

//////////////////////////////////////////////////////////////////////////
// Constant and data type/structure definitions


/*{{- $prefix := .Prefix}}

Custom environment settings:
{{range .Options}}
- **{{$prefix}}
{{- if .EVar}}{{.EVar}}
{{- else}}{{clk2ss .Name}}
{{- end}}**: {{.Usage}} ({{.Type}}{{- if .Value}}="{{.Value}}"{{end}})
{{- end}}

*/

type envConfig struct { {{- range .Options}}
	{{.Name}}	{{.Type}}	`env:"{{$prefix}}
{{- if .EVar}}{{.EVar}}
{{- else}}{{clk2ss .Name}}
{{- end}}"
{{- if .Value}} envDefault:"{{.Value}}"{{end}}`	// {{.Usage}}
{{- end}}
}

////////////////////////////////////////////////////////////////////////////
// Global variables definitions

//  var (
//          progname  = "{{.Name}}"
//          version   = "0.1.0"
//          date = "{{ date "I" }}"

//          e envConfig
//  )