Skip to content

Commit 23f612d

Browse files
authored
Allow customization of the attribution text in the CLI (#121)
1 parent c60efeb commit 23f612d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

create-static-map/create-static-map.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ func main() {
171171
Areas []string `short:"a" long:"area" description:"Add an area to the static map" value-name:"AREA"`
172172
Circles []string `short:"C" long:"circle" description:"Add a circle to the static map" value-name:"CIRCLE"`
173173
ThunderforstAPIKey string `long:"thunderforestapikey" description:"API key to use with Thunderforst tile servers" value-name:"APIKEY" default:"NONE"`
174+
Attribution string `long:"attribution" description:"Override the attribution text" value-name:"ATTRIBUTION"`
174175
}
175176

176177
parser := flags.NewParser(&opts, flags.HelpFlag|flags.PassDoubleDash)
@@ -213,6 +214,10 @@ func main() {
213214
ctx.SetUserAgent(opts.UserAgent)
214215
}
215216

217+
if parser.FindOptionByLongName("attribution").IsSet() {
218+
ctx.OverrideAttribution(opts.Attribution)
219+
}
220+
216221
handleAreasOption(ctx, opts.Areas)
217222
handleMarkersOption(ctx, opts.Markers)
218223
handleImageMarkersOption(ctx, opts.ImageMarkers)

0 commit comments

Comments
 (0)