#!/usr/bin/env perl6

use META6::To::Man;

if !@*ARGS {
   say qq:to/HERE/;
   Usage: $*PROGRAM --meta6=M [options...]

     Produces a UNIX 'man' page from data in the Perl 6 META6 file 'M'.
     The output is written to file 'F.1' where 'F' is the name from the META6
     file (which can be changed with the '--man' option below).

   Mandatory argument:

     --meta6=M       Defines the desired META6.json file to be used. 'M' must be a
                     valid META6 file.

   Options:

     --install       Installs the output file to one of the standard man
                     directories. The directory actually chosen is the first
                     one found with write privileges for the user.  The
                     directories are searched in this order:

                       /usr/share/man/manN
                       /usr/local/share/man/manN
                       /usr/local/man/manN

     --install-to=D  Installs the output file to directory D.

     --date=YYYY-MM-DD
                     The default is the current date.

     --man=F         Defines the man roff file 'F'. It is an error if
                     the file name does not end in '.N' where 'N' is a digit in
                     the range '1..8'.

     --quiet         Silences all messages. Normally for developer use.

     --debug         Normally for developer use.
   HERE
   exit
}

meta6-to-man @*ARGS;
