Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools for technical analysts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
tools for technical analysts
Commits
6248f0b3
Commit
6248f0b3
authored
1 year ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- fixed options
parent
3b811c57
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/SLUB/LZA/TA/Command/init.pm
+17
-12
17 additions, 12 deletions
lib/SLUB/LZA/TA/Command/init.pm
with
17 additions
and
12 deletions
lib/SLUB/LZA/TA/Command/init.pm
+
17
−
12
View file @
6248f0b3
...
...
@@ -12,24 +12,29 @@ use namespace::autoclean -except => qr{^SLUB::LZA::TA::.*};
# ABSTRACT: init module for ta-tool
sub
abstract
{
return
"
Initialize $0
";}
sub
description
{
return
"
Initialize $0, preparing config file
.
"}
sub
description
{
return
"
Initialize $0, preparing config file
using given options
"}
sub
opt_spec
{
return
(
["
help|h
"
=>
"
this usage screen
"],
#my $common_global_opts= SLUB::LZA::TA::global_opt_spec();
my
@local_opts
=
(
[
"
help|h
"
=>
"
this usage screen
"
],
[
"
verbose|v
"
=>
"
enable verbose output
"
],
[]
,
[
"
elasticsearch-host|e=s
"
=>
"
host adress of Archivematica's ElasticSearch (mandatory)
"
],
[
"
elasticsearch-port|E=s
"
=>
"
port of Archivematica's ElasticSearch
",
{
default
=>
9200
}
],
[
"
http-only
"
=>
"
use HTTP instead HTTPS
"
],
);
#[ "logdir|l=s" => "logdir where Archivematica stores it server log files", {required => 1}],
# return ($global_opts, $local_opts);
return
(
@local_opts
);
}
sub
validate_args
{
my
(
$self
,
$opt
,
$args
)
=
@_
;
# no args allowed but options!
$self
->
usage_error
("
No args allowed
")
if
@$args
;
my
$app
=
$self
->
app
;
my
$global
=
$app
->
global_options
;
SLUB::LZA::TA::
validate_global
(
$self
,
$opt
,
$args
);
use
Data::
Printer
;
p
(
$opt
);
$self
->
usage_error
("
This command requires (global) parameter for elasticsearch host!
")
if
(
!
exists
$opt
->
{
elasticsearch_host
});
$self
->
usage_error
("
This command requires (global) parameter for logdir!
")
if
(
!
exists
$opt
->
{
logdir
});
$self
->
usage_error
("
Missed mandatory parameter '--elasticsearch-host'
")
if
(
!
exists
(
$opt
->
{
elasticsearch_host
})
and
exists
(
$opt
->
{
help
})
);
return
1
;
}
...
...
@@ -38,7 +43,7 @@ sub execute {
my
%config
;
$config
{
elasticsearch_host
}
=
$opt
->
{
elasticsearch_host
};
$config
{
elasticsearch_port
}
=
$opt
->
{
elasticsearch_port
};
$config
{
logdir
}
=
$opt
->
{
logdir
};
#
$config{logdir} = $opt->{logdir};
$config
{
http_only
}
=
$opt
->
{
http_only
};
my
$in_test
=
$ENV
{
TEST_ACTIVE
};
local
*
IO::Prompt::Tiny::
_is_interactive
=
sub
{
$in_test
};
# fake it for testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment