#!/usr/bin/env perl use warnings; use strict; use 5.010; # tool to make a pod file generated from equo --help # which can be used to make a manual page # A tip: # if this tool gives badly formatted text due to missing \t etc. in equo # output, it's easier to save equo output to file, correct it and pipe # using cat. # by Enlik my @strs; # @strs: { }, { }, ... # el - hash: indent => <0..n>, command => , desc => # command line arg: # -p generate pod file # -w generate in MediaWiki format # pass to stdin equo --help (English), # you may use: LANG=en_US.UTF-8 equo | perl if (@ARGV and $ARGV[0] eq "-p") { require Pod; @strs = parse_input(); my $conv = Pod->new(\@strs); $conv->generate; } elsif (@ARGV and $ARGV[0] eq "-w") { require Wiki; @strs = parse_input(); my $conv = Wiki->new(\@strs); $conv->generate; } else { say "usage: equo --help | perl $0