+sub promptstring($$$$$)
+{
+ my ($prompt, $configitem, $default, $package, $commandlineswitch) = @_;
+ my $var;
+ if (!$main::interactive)
+ {
+ undef $opt_commandlineswitch;
+ GetOptions ("$commandlineswitch=s" => \$opt_commandlineswitch);
+ if (defined $opt_commandlineswitch)
+ {
+ print "\033[1;32m$opt_commandlineswitch\033[0m\n";
+ $var = $opt_commandlineswitch;
+ }
+ else
+ {
+ die "Could not detect $package! Please specify the $prompt via the command line option \033[1;32m--$commandlineswitch=\"/path/to/file\"\033[0m";
+ }
+ }
+ else
+ {
+ 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;
+}
+