diff options
author | B Stack <bgstack15@gmail.com> | 2019-02-02 13:20:04 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-02-02 13:20:04 +0000 |
commit | 6fd541d7510f66d91a38a83b1a3ff01ae6fbfe3f (patch) | |
tree | 85e7694e00578f4353b3f7da419d4749437e0532 /veracrypt/debian/veracrypt_help_to_troff.pl | |
parent | Merge branch 'freefilesync-dpkg' into 'master' (diff) | |
parent | add veracrypt dpkg first draft (diff) | |
download | stackrpms-6fd541d7510f66d91a38a83b1a3ff01ae6fbfe3f.tar.gz stackrpms-6fd541d7510f66d91a38a83b1a3ff01ae6fbfe3f.tar.bz2 stackrpms-6fd541d7510f66d91a38a83b1a3ff01ae6fbfe3f.zip |
Merge branch 'veracrypt-dpkg' into 'master'
veracrypt dpkg for devuan
See merge request bgstack15/stackrpms!34
Diffstat (limited to 'veracrypt/debian/veracrypt_help_to_troff.pl')
-rwxr-xr-x | veracrypt/debian/veracrypt_help_to_troff.pl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/veracrypt/debian/veracrypt_help_to_troff.pl b/veracrypt/debian/veracrypt_help_to_troff.pl new file mode 100755 index 0000000..359158d --- /dev/null +++ b/veracrypt/debian/veracrypt_help_to_troff.pl @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w +use strict; + +open(OUT, ">&STDOUT") or die "Couldn't dup STDOUT: $!"; +open(IN, "<&STDIN" ) or die "Couldn't dup STDIN : $!"; + +print OUT ".TH VERACRYPT 1\n"; +print OUT ".SH NAME\n"; +print OUT "veracrypt \\- create and mount VeraCrypt encrypted volumes\n"; + +my $section = ""; + +while(my $line = <IN>) +{ + if ($line =~ m/^([a-z_]+):$/i) + { + $section= lc($1); + } + + my $out = $line; + + if ($line =~ m/^[a-z_]+:$/i) + { + $line =~ s/://; + $line = ".SH " . $line; + + $out = uc($line); + } + elsif ($section eq "synopsis") + { + $line =~ s/([A-Z_]+)/\\fI$1\\fP/g; + $out = $line."\n"; + } + elsif ($section eq "examples") + { + if ($line =~ m/^.*:$/) + { + $out = ".PP\n.B $line"; + } + elsif ($line =~ m/.+/) + { + $out = ".nf\n$line.fi\n"; + } + } + elsif ($line =~ m/^-/) + { + $out = ".TP\n.B ".$line; + } + + # In general, the hyphen-minus is meant to be a minus. + $out =~ s/-/\\-/g; + print OUT $out +} + +print OUT ".SH COPYRIGHT\n"; +print OUT "VeraCrypt is \\(co 2012 TrueCrypt Developers Association. All rights reserved.\n"; + +print OUT ".PP\nThis manual page was automatically generated from the output of \\fBveracrypt \\-\\-help\\fP\n"; + +close(IN); +close(OUT); |