-f option

This commit is contained in:
Al Beano 2016-09-05 12:26:10 +01:00
parent e81c1b1bc2
commit b743807fb2
2 changed files with 13 additions and 1 deletions

View File

@ -13,9 +13,16 @@ sub config( $ ) {
# config(var)
# returns config value
my $file = "$Bin/config.yml";
for (0..$#ARGV) {
if ($ARGV[$_] eq "-f") {
$file = $ARGV[$_+1];
}
}
my $var = shift;
my $yaml = YAML::Tiny->read( "$Bin/config.yml" );
my $yaml = YAML::Tiny->read( $file );
return $yaml->[0]->{$var};
}

View File

@ -73,6 +73,11 @@ Now, just run `perl MarkovBot.pl`.
< shithead-ng> Pong!
```
## Command line options
```text
-f: specify a YAML config file for shithead-ng to use. Defaults to /path/to/shithead-ng/config.yml.
```
## Exporting the brainfile
```bash