]> git.refcnt.org Git - colorize.git/blob - version.pl
Omit declaration of optind/optarg
[colorize.git] / version.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my $version = '';
7
8 # git repository
9 if (system('which git >/dev/null 2>&1') == 0
10 and system('git ls-files colorize.c --error-unmatch >/dev/null 2>&1') == 0) {
11 $version = `git describe --tags --dirty`;
12 $version =~ s/\n$//g;
13 }
14
15 if (length $version) {
16 print <<"EOT";
17 const char *const version = "$version";
18 EOT
19 }
20 else {
21 print <<'EOT';
22 const char *const version = NULL;
23 EOT
24 }