-f option
This commit is contained in:
parent
e81c1b1bc2
commit
b743807fb2
|
@ -13,9 +13,16 @@ sub config( $ ) {
|
||||||
# config(var)
|
# config(var)
|
||||||
# returns config value
|
# returns config value
|
||||||
|
|
||||||
|
my $file = "$Bin/config.yml";
|
||||||
|
for (0..$#ARGV) {
|
||||||
|
if ($ARGV[$_] eq "-f") {
|
||||||
|
$file = $ARGV[$_+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my $var = shift;
|
my $var = shift;
|
||||||
|
|
||||||
my $yaml = YAML::Tiny->read( "$Bin/config.yml" );
|
my $yaml = YAML::Tiny->read( $file );
|
||||||
return $yaml->[0]->{$var};
|
return $yaml->[0]->{$var};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,11 @@ Now, just run `perl MarkovBot.pl`.
|
||||||
< shithead-ng> Pong!
|
< 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
|
## Exporting the brainfile
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Reference in New Issue