-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli_values.php~
More file actions
46 lines (42 loc) · 1.26 KB
/
cli_values.php~
File metadata and controls
46 lines (42 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
$args = array(
"ver" => array("short" => "v",
"long" => "version",
"switch" => TRUE,
"info" => "Displays version information",
),
"help"=> array("short" => "h",
"long" => "help",
"info" => "Shows this page",
"switch" => TRUE,
)
"foo" => array('short' => "f",
"info" => "This is damn long senseless description just to test ShowHelpPage() text wrapper. This is is damn long senseless description just to test ShowHelpPage() text wrapper. This is damn long senseless description just to test ShowHelpPage() text wrapper."
),
);
/* stop config values */
$cCLI = new CLI( $args );
$log_main->info(_('Loaded to memory the cli lib.'));
$result = $cCLI->Parse( $argc, $argv );
if( $cCLI->IsOptionSet("help") ){
$cCLI->ShowHelpPage();
$log_main->info(_('Help Page printed.'));
exit( 0 );
}
if( $cCLI->IsOptionSet("ver") ){
printf(_("Class version: %s\n"), $app['vercion']);
$log_main->info(_('Vercion page printed.'));
exit(o);
}
if( $argc == 1 ){
printf(_("Type %s -help for details\n"), $argv[0]);
$log_main->warn(_('No param send.'));
$log_main->info(_('Printed help mensage.'));
}
if(!$result){
$log_main->warn(_('error.'));
$log_main->debug($cCLI->ShowHelpPage());
$log_main->debug($cCLI->ShowErrors());
exit();
}
?>