Haineko::CLI - Base class for command line interface
Haineko::CLI is a base class for command line interface of Haineko.
use Haineko::CLI; my $p = { 'pidfile' => '/tmp/haineko.pid' }; my $c = Haineko::CLI::Daemon->new( %$p ); $c->parseoptions; # Parse command-line options $c->makepf; # Make a pid file $c->readpf; # Return the process id of running process $c->removepf; # Remove the pid file
new( %arguments )
new() is a constructor of Haineko::CLI::Daemon
new()
my $e = Haineko::CLI::Daemon->new( 'verbose' => 2, # Verbose level 'logging' => { # Syslog configuration 'disabled' => 0, 'facility' => 'local2', }, 'pidfile' => '/tmp/pid',# process id file );
version
version() returns the version number of Haineko.
version()
which( command-name )
which() has the same feature of UNIX-command ``which''.
which()
stdin
stdin() returns the result of -t STDIN.
stdin()
-t STDIN
stdout
stdout() returns the result of -t STDOUT.
stdout()
-t STDOUT
stderr
stderr() returns the result of -t STDERR.
stderr()
-t STDERR
r() returns current "run mode" value, and r(2) set "run mode" to ``2''
r()
r(2)
v() returns current verbose level value, and v(2) set "verbose level" to ``2''
v()
v(2)
e() prints error message to STDERR and exit. if the second argument is given, such as e('message', 1), running process does not exit.
e()
e('message', 1)
p() prints message to STDERR. if the second argument is given, for example, p('message',2), given message will be printed when the value of verbose level is 2 or higher.
p()
p('message',2)
makepf() creates pid file at the value of pidfile property of the instance. If the value of pidfile is not defined or is empty, pid file is not created.
makepf()
pidfile
readpf() returns the process id of running process read from the value of pidfile property of running process.
readpf()
removepf() delete the pid file.
removepf()
Haineko::CLI::Daemon - Control Haineko server
Haineko::CLI::Setup - Setup files for Haineko
Haineko::CLI::Password - Password generator for Basic Authentication
Haineko::CLI::Help - Help message for hainekoctl
hainekoctl
"haineoctl" in bin - Script of Haineko::CLI::* implementation
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.