Use cli options

main
parent 6f0e5e022a
commit 4967e57243
  1. 13
      wiki-tile.pl

@ -1,9 +1,11 @@
use v5.30; use v5.30;
use MediaWiki::API;
use HexGrid; use HexGrid;
use HexGrid::Pin; use HexGrid::Pin;
use MWTemplate; use MWTemplate;
use MediaWiki::API;
use Getopt::Long;
use Carp; use Carp;
use Data::Dumper; use Data::Dumper;
@ -20,6 +22,15 @@ my $border_width = 1;
my $border_colour = 'black'; my $border_colour = 'black';
my $show_coords = 0; 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 => { my $grid = HexGrid->new(defaults => {
style => { 'stroke-width' => $border_width, stroke => $border_colour }, style => { 'stroke-width' => $border_width, stroke => $border_colour },
show_coords => $show_coords }); show_coords => $show_coords });

Loading…
Cancel
Save