build_selenium_spec.pl 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/perl
  2. package Bin::build_selenium_spec;
  3. #ABSTRACT: Convenience script to fetch the selenium specification from WC3
  4. use strict;
  5. use warnings;
  6. use v5.28;
  7. no warnings 'experimental';
  8. use feature qw/signatures/;
  9. use Getopt::Long qw{GetOptionsFromArray};
  10. use Pod::Usage;
  11. use Selenium::Specification;
  12. exit main(@ARGV) unless caller;
  13. sub main(@args) {
  14. my %options;
  15. GetOptionsFromArray(\@args,
  16. 'verbose' => \$options{verbose},
  17. 'dir=s' => \$options{dir},
  18. 'force' => \$options{force},
  19. 'help' => \$options{help},
  20. );
  21. return pod2usage(verbose => 2, noperldoc => 1) if $options{help};
  22. Selenium::Specification::fetch(%options);
  23. }
  24. 1;
  25. __END__
  26. =head1 build_selenium_spec.pl
  27. Fetches the latest versions of the Selenium specification(s) from the internet and stores them in
  28. ~/.selenium/specs
  29. As a variety of JSON files.
  30. =head1 USAGE
  31. =head2 -h --help
  32. Print this message
  33. =head2 -v, --verbose
  34. Print messages rather than being silent
  35. =head2 -d --dir $DIR
  36. Put the files in a different directory than the default.
  37. =head2 -f --force
  38. Force a re-fetch even if your copy is newer than that available online.
  39. Use to correct corrupted specs.