From 4967e57243862530e986bd1d16a015820487cadb Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Sat, 1 Jul 2023 12:53:46 -0500 Subject: [PATCH] Use cli options --- wiki-tile.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wiki-tile.pl b/wiki-tile.pl index ad7f11a..723ec47 100644 --- a/wiki-tile.pl +++ b/wiki-tile.pl @@ -1,9 +1,11 @@ use v5.30; -use MediaWiki::API; use HexGrid; use HexGrid::Pin; use MWTemplate; +use MediaWiki::API; + +use Getopt::Long; use Carp; use Data::Dumper; @@ -20,6 +22,15 @@ my $border_width = 1; my $border_colour = 'black'; my $show_coords = 0; +GetOptions( + 'border-width=f' => \$border_width, + 'border-colour|border-color=s' => \$border_colour, + 'show-coords|coords!' => \$show_coords, + 'api-url=s' => \$api_url, + 'region-template-name=s' => \$region_template_name, + 'site-template-name=s' => \$site_template_name +); + my $grid = HexGrid->new(defaults => { style => { 'stroke-width' => $border_width, stroke => $border_colour }, show_coords => $show_coords });