]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/configure.pm
Proritise cached value above a search
[user/henk/code/inspircd.git] / make / configure.pm
index 7965436c2501efd138f12eb4f192afabb3c6079f..7b0a354548a2113d7063abb9cc09ca5454f82400 100644 (file)
@@ -2,7 +2,7 @@ package make::configure;
 use Exporter 'import';
 use POSIX;
 use make::utilities;
-@EXPORT = qw(promptnumeric dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies resolve_directory yesno showhelp);
+@EXPORT = qw(promptnumeric promptstring dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies resolve_directory yesno showhelp);
 
 my $no_svn = 0;
 
@@ -139,6 +139,19 @@ sub promptnumeric($$)
        }
 }
 
+sub promptstring($$$)
+{
+       my ($prompt, $configitem, $default) = @_;
+       print "\nPlease enter the $prompt?\n";
+       print "[\033[1;32m$default\033[0m] -> ";
+       chomp($var = <STDIN>);
+       if ($var eq "")
+       {
+               $var = $default;
+       }
+       $main::config{$configitem} = $var;
+}
+
 sub dumphash()
 {
        print "\n\033[1;32mPre-build configuration is complete!\033[0m\n\n";