NAME
faker
ABSTRACT
Fake Data Generation Tool
SYNOPSIS
Faker - Fake Data Generator
Usage: faker <command> [options]
Commands:
address_lines Generate address lines
company_name Generate company name
company_tagline Generate company tagline
lorem_paragraphs Generate lorem paragraphs
lorem_sentences Generate lorem sentences
lorem_words Generate lorem words
person_name Generate person name
software_name Generate software name
software_semver Generate software semver
software_version Generate software version
telephone_number Generate telephone number
user_login Generate user login
user_password Generate user password
...
Options:
-l --locales Specify the locale(s), e.g. en-us, ja-jp, es-es
-r --repeats Specify the number of repetitions, e.g. 10
DESCRIPTION
This tool lets you generate faker data, using the Faker framework.
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
See Faker
NAME
Venus::Cli - Cli Class
ABSTRACT
Cli Class for Perl 5
SYNOPSIS
package main;
use Venus::Cli;
@ARGV = ('example', '--help');
my $cli = Venus::Cli->new;
# $cli->program;
# "/path/to/executable"
# $cli->arg(0);
# "example"
# $cli->opt('help');
# 1
DESCRIPTION
This package provides a superclass and methods for providing simple yet robust command-line interfaces.
INHERITS
This package inherits behaviors from:
INTEGRATES
This package integrates behaviors from:
METHODS
This package provides the following methods:
arg
arg(Str $pos) (Str)
The arg method returns the element specified by the index in the unnamed arguments list, i.e. arguments not parsed as options.
Since 1.68
execute
execute() (Any)
The execute method is the default entrypoint of the program and runs the application.
Since 1.68
- execute example 1
-
package main; use Venus::Cli; @ARGV = (); my $cli = Venus::Cli->new; # e.g. # sub execute { # my ($self) = @_; # # return $self->opt('help') ? $self->okay : $self->fail; # } # my $result = $cli->execute; # ...
- execute example 2
-
package main; use Venus::Cli; @ARGV = ('--help'); my $cli = Venus::Cli->new; # e.g. # sub execute { # my ($self) = @_; # # return $self->opt('help') ? $self->okay : $self->fail; # } # my $result = $cli->execute; # ...
exit
exit(Int $code, Str|CodeRef $code, Any @args) (Any)
The exit method exits the program using the exit code provided. The exit code defaults to 0
. Optionally, you can dispatch before exiting by providing a method name or coderef, and arguments.
Since 1.68
- exit example 4
-
# given: synopsis package main; # my $exit = $cli->exit(1, 'log_info', 'Something failed!'); # ()
fail
fail(Str|CodeRef $code, Any @args) (Any)
The fail method exits the program with the exit code 1
. Optionally, you can dispatch before exiting by providing a method name or coderef, and arguments.
Since 1.68
- fail example 2
-
# given: synopsis package main; # my $fail = $cli->fail('log_info', 'Something failed!'); # ()
help
help(Str @data) (Str)
The help method returns the POD found in the file specified by the "podfile" method, defaulting to the =head1 OPTIONS
section.
Since 1.68
- help example 2
-
# given: synopsis package main; # my $help = $cli->help('head1', 'NAME'); # "Example"
init
init() (ArrayRef)
The init method returns the raw arguments provided, defaulting to @ARGV
, used by "args" and "opts".
Since 1.68
log_debug
log_debug(Str @data) (Log)
The log_debug method logs debug
information.
Since 1.68
- log_debug example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_debug(time, 'Something failed!'); # "0000000000 Something failed!"
log_error
log_error(Str @data) (Log)
The log_error method logs error
information.
Since 1.68
- log_error example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_error(time, 'Something failed!'); # "0000000000 Something failed!"
log_fatal
log_fatal(Str @data) (Log)
The log_fatal method logs fatal
information.
Since 1.68
- log_fatal example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_fatal(time, 'Something failed!'); # "0000000000 Something failed!"
log_info
log_info(Str @data) (Log)
The log_info method logs info
information.
Since 1.68
- log_info example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_info(time, 'Something failed!'); # "0000000000 Something failed!"
log_trace
log_trace(Str @data) (Log)
The log_trace method logs trace
information.
Since 1.68
- log_trace example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_trace(time, 'Something failed!'); # "0000000000 Something failed!"
log_warn
log_warn(Str @data) (Log)
The log_warn method logs warn
information.
Since 1.68
- log_warn example 1
-
# given: synopsis package main; # $cli->logs->level('trace'); # my $log = $cli->log_warn(time, 'Something failed!'); # "0000000000 Something failed!"
okay
okay(Str|CodeRef $code, Any @args) (Any)
The okay method exits the program with the exit code 0
. Optionally, you can dispatch before exiting by providing a method name or coderef, and arguments.
Since 1.68
- okay example 2
-
# given: synopsis package main; # my $okay = $cli->okay('log_info', 'Something worked!'); # ()
opt
opt(Str $name) (Str)
The opt method returns the named option specified by the "options" method.
Since 1.68
options
options() (ArrayRef)
The options method returns the list of Getopt::Long definitions.
Since 1.68
podfile
podfile() (Str)
The podfile method returns the full path to the file where the CLI POD is.
Since 1.68
program
program() (Str)
The program method returns the full path to the CLI executable.
Since 1.68