NaturalDocs:: Settings

A package to handle the command line and various other program settings. 

Usage and Dependencies

Summary
A package to handle the command line and various other program settings.
The input directory.
The project directory.
A hash of the output formats and directories being used.
Whether the script should rebuild all output and data files from scratch.
Whether the script should be run in quiet mode or not.
The style to be used if an output format doesn’t have its own style specified.
A hash of the output format styles.
Parses and validates the command line.
Prints the syntax reference.
Returns the input directory.
Returns the output directory of an output format.
Returns a hashref of the output formats and their directories.
Returns the style associated with an output format.
Returns the project directory.
Returns the main style directory.
Returns whether the script should rebuild all output and data files from scratch.
Returns whether the script should be run in quiet mode or not.
Returns a string of the current version number of Natural Docs.
Returns a string of the project’s current web address.
Returns a string of the current file version number of Natural Docs.

Variables

inputDirectory

my $inputDirectory

The input directory. 

projectDirectory

my $projectDirectory

The project directory. 

outputFormats

my %outputFormats

A hash of the output formats and directories being used.  The keys are the package names, and the values are their corresponding directories. 

rebuildAll

my $rebuildAll

Whether the script should rebuild all output and data files from scratch. 

isQuiet

my $isQuiet

Whether the script should be run in quiet mode or not. 

defaultOutputStyle

my $defaultOutputStyle

The style to be used if an output format doesn’t have its own style specified. 

outputStyles

my %outputStyles

A hash of the output format styles.  The keys are the package names, and the values are the style strings.  If a package does not have an entry in this hash, it uses defaultOutputStyle

Functions

ParseCommandLine

sub ParseCommandLine

Parses and validates the command line.  Will cause the script to exit if the options ask for the syntax reference or are invalid.  Needs to be run before calling any other functions in this package. 

PrintSyntax

sub PrintSyntax

Prints the syntax reference. 

InputDirectory

sub InputDirectory

Returns the input directory. 

OutputDirectory

sub OutputDirectory #(package)

Returns the output directory of an output format. 

Parameters

packageThe output package. 

Returns

The output format directory, or undef if the format wasn’t specified. 

OutputFormats

sub OutputFormats

Returns a hashref of the output formats and their directories.  The keys are the package names, and the values are their directories.  The hashref is not a copy of the data, so don’t change it. 

OutputStyle

sub OutputStyle #(package)

Returns the style associated with an output format. 

Parameters

packageThe output package. 

Returns

The style string. 

ProjectDirectory

sub ProjectDirectory

Returns the project directory. 

StyleDirectory

sub StyleDirectory

Returns the main style directory. 

RebuildAll

sub RebuildAll

Returns whether the script should rebuild all output and data files from scratch. 

IsQuiet

sub IsQuiet

Returns whether the script should be run in quiet mode or not. 

Constant Functions

AppVersion

sub AppVersion

Returns a string of the current version number of Natural Docs. 

AppURL

sub AppURL

Returns a string of the project’s current web address. 

FileVersion

sub FileVersion

Returns a string of the current file version number of Natural Docs.  This may be different from AppVersion.  If ever a data file is loaded that doesn’t match this version, the file should be regenerated.  This prevents upgrades/downgrades to versions that have different file formats from causing errors.