diff options
author | EuAndreh <eu@euandre.org> | 2020-01-24 13:35:04 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-01-24 13:35:04 -0300 |
commit | 634cf7dc7cf745fa2bc1a61c56667bfae8987d54 (patch) | |
tree | de7b8171c6f70bd4266947f38ddedd75bf0fffca /pastebin | |
parent | Migrate existing templates to build with hakyll instead of pandoc directly (diff) | |
download | euandre.org-634cf7dc7cf745fa2bc1a61c56667bfae8987d54.tar.gz euandre.org-634cf7dc7cf745fa2bc1a61c56667bfae8987d54.tar.xz |
website-pastebin: parameterize --lang value
Diffstat (limited to 'pastebin')
-rw-r--r-- | pastebin/skeleton.org | 2 | ||||
-rwxr-xr-x | pastebin/website-pastebin | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/pastebin/skeleton.org b/pastebin/skeleton.org index f97da72..d116991 100644 --- a/pastebin/skeleton.org +++ b/pastebin/skeleton.org @@ -2,6 +2,6 @@ title: $title date: $date --- -#+BEGIN_SRC FIXME -n +#+BEGIN_SRC $lang -n FIXME #+END_SRC diff --git a/pastebin/website-pastebin b/pastebin/website-pastebin index 0d38ac2..9aa4956 100755 --- a/pastebin/website-pastebin +++ b/pastebin/website-pastebin @@ -42,10 +42,12 @@ use Term::ANSIColor; my $help = 0; my $title = ''; +my $lang = ''; my $test = 0; GetOptions( 'help|h|?' => \$help, 'title|t=s' => \$title, + 'lang|l=s' => \$lang, 'test|?' => \$test ) or pod2usage(-verbose => 1, -exitval => 2); pod2usage( @@ -57,6 +59,11 @@ pod2usage( -exitval => 2, -message => colored("Missing required --title argument.", "red") ) if !$title && !$test; +pod2usage( + -verbose =>1, + -exitval => 2, + -message => colored("Missing required --lang argument.", "red") +) if !$lang && !$test; # Taken from: # https://stackoverflow.com/a/4009519 @@ -87,7 +94,7 @@ our $in = "$dirname/skeleton.org"; our $out; my $date = `date +"%Y-%m-%d"`; chomp $date; -my %ENV = (title => $title, date => $date); +my %ENV = (title => $title, date => $date, lang => $lang); # Derived from both: # https://unix.stackexchange.com/a/294836 |