NAME
CTK - Command-line ToolKit
VERSION
Version 1.18
SYNOPSIS
use CTK;
use CTK qw( :BASE ); # :SUBS and :VARS tags to export
use CTK qw( :SUBS ); # :SUBS tag only to export
use CTK qw( :VARS ); # :VARS tag only to export
my $c = new CTK;
my $c = new CTK (
prefix => 'myprogram',
suffix => 'sample',
cfgfile => '/path/to/conf/file.conf',
voidfile => '/path/to/void/file.txt',
needconfig => 1, # need creating empty config file
loglevel => 'info', # or '1'
logfile => CTK::catfile($LOGDIR,'foo.log'),
logseparator => ' ', # as default
);
ABSTRACT
CTKlib - Command-line ToolKit library (CTKlib). Command line interface (CLI)
DESCRIPTION
CTKlib - is library that provides "extended-features" (utilities) for your robots written on Perl. Most of the functions and methods this module written very simple language and easy to understand. To work with CTKlib, you just need to start using it!
See also README
file
new
my $c = new CTK;
my $c = new CTK ( syspaths => 1 ); # need use system paths
my $c = new CTK (
prefix => 'myprogram',
suffix => 'sample',
cfgfile => '/path/to/conf/file.conf',
voidfile => '/path/to/void/file.txt',
needconfig => 1, # need creating empty config file
loglevel => 'info', # or '1'
logfile => CTK::catfile($LOGDIR,'foo.log'),
logseparator => ' ', # as default
);
Main constructor. All the params are optional
- cfgfile
-
Full path to the configuration file of the your project
- logfile
-
Full path to the log file
- loglevel
-
Logging level. It can be set as: debug, info, notice, warning, error, crit, alert, emerg, fatal and except.
- logseparator
-
Separator for log columns. The default is the space character (" ")
- needconfig
-
Specifies the need to create an empty configuration file. Not recommended for use
- prefix, suffix
-
Prefix and suffix of the name your project
- syspaths
-
The directive specifies the use of system paths for configuration, logging and allocation of temporary and working data
- voidfile
-
Full path to the VOID file for connections testing
init, again
For internal use only. Please not call this functions
debug
Prints debug information on STDOUT or into general log-file
debugmode
Returns debug flag set. 1 - on, 0 - off
exception
Shows error and immediately exit from program with die state
logmode
Returns log flag set. 1 - on, 0 - off
say
Prints a string or a list of strings implicitly appends a newline
silentmode
Returns the verbose flag in the opposite value. 0 - verbose, 1 - silent. See "verbosemode"" in "
testmode
Returns test flag set. 1 - on, 0 - off
tms
Returns timestamp. For example: [8588] {TimeStamp: +0.5580 sec}
verbosemode
Returns verbose flag set. 1 - on, 0 - off
HISTORY
See CHANGES
file for details
DEPENDENCIES
Archive::Extract, Archive::Tar, Archive::Zip, Config::General, DBI, ExtUtils::MakeMaker, File::Copy, File::Path, File::Pid, File::Spec, HTTP::Headers, HTTP::Request, HTTP::Response, IO::Handle, IPC::Open3, LWP, LWP::MediaTypes, LWP::UserAgent, MIME::Base64, MIME::Lite, Moose, namespace::autoclean, Net::FTP, Perl::OSType, Sys::SigAction, Term::ReadKey, Term::ReadLine, Test::More, Text::ParseWords, Time::Local, Time::HiRes, URI, YAML
TO DO
See TODO
file
BUGS
* none noted
SEE ALSO
perl
, Moose, CTK::Util, CTK::DBI, CTK::Status, CTK::FilePid, CTK::CPX
DIAGNOSTICS
The usual warnings if it can't read or write the files involved.
AUTHOR
Sergey Lepenkov (Serz Minus) http://www.serzik.com <minus@mail333.com>
COPYRIGHT
Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms and conditions as Perl itself.
This program is distributed under the GNU LGPL v3 (GNU Lesser General Public License version 3).
See LICENSE
file