]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - tools/directive
Improve the `./configure --help` output
[user/henk/code/inspircd.git] / tools / directive
index 95fe847ac22cb65e67a9a0b68397dda0f3e86d4d..c743ed3e67e3b15e923133e665b547fbf151b6b6 100755 (executable)
 #
 
 
-BEGIN {
-       require 5.10.0;
-       unless (-f 'configure') {
-               print "Error: $0 must be run from the main source directory!\n";
-               exit 1;
-       }
-}
-
-use feature ':5.10';
+use v5.10.0;
 use strict;
 use warnings FATAL => qw(all);
 
@@ -38,7 +30,7 @@ use make::console;
 use make::directive;
 
 if (scalar @ARGV < 2) {
-       print_format "<|GREEN Usage:|> $0 <<|UNDERLINE FILE|>> [<|UNDERLINE DIRECTIVES...|>]\n", *STDERR;
+       say STDERR console_format "<|GREEN Usage:|> $0 <<|UNDERLINE FILE|>> [<|UNDERLINE DIRECTIVES...|>]";
        exit 1
 }
 
@@ -48,7 +40,7 @@ print_error "<|GREEN $file|> does not exist and/or is not a file!" unless -f $fi
 for my $directive (@ARGV) {
        my $value = get_directive $file, $directive, '';
        if (-t STDOUT) {
-               print_format "<|GREEN $directive|>: $value\n";
+               say console_format "<|GREEN $directive|>: $value";
        } else {
                say $value;
        }