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
9d6fa761
Commit
9d6fa761
authored
1 year ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- fixed override mode
- added testcase for override mode
parent
5c815d06
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/SLUB/LZA/TA/Command/info.pm
+3
-3
3 additions, 3 deletions
lib/SLUB/LZA/TA/Command/info.pm
t/03-info.t
+10
-1
10 additions, 1 deletion
t/03-info.t
with
13 additions
and
4 deletions
lib/SLUB/LZA/TA/Command/info.pm
+
3
−
3
View file @
9d6fa761
...
@@ -20,19 +20,19 @@ sub description {
...
@@ -20,19 +20,19 @@ sub description {
sub
opt_spec
{
sub
opt_spec
{
my
@global_opts
=
SLUB::LZA::TA::
common_global_opt_spec
();
my
@global_opts
=
SLUB::LZA::TA::
common_global_opt_spec
();
my
@local_opts
=
(
my
@local_opts
=
(
[
'
target-version|T
'
=>
'
get current elasticsearch version
'
,
{
shortcircuit
=>
1
}
],
[
'
target-version|T
'
=>
'
get current elasticsearch version
'],
[
'
version|V
',
'
print
'
.
$
0
.
'
version information
'
,
{
shortcircuit
=>
1
}
],
[
'
version|V
',
'
print
'
.
$
0
.
'
version information
'],
);
);
return
(
@global_opts
,
[]
,
@local_opts
);
return
(
@global_opts
,
[]
,
@local_opts
);
}
}
sub
validate_args
{
sub
validate_args
{
my
(
$self
,
$opt
,
$args
)
=
@_
;
my
(
$self
,
$opt
,
$args
)
=
@_
;
SLUB::LZA::TA::
common_global_validate
(
$self
,
$opt
,
$args
);
# no args allowed but options!
# no args allowed but options!
$self
->
usage_error
("
No args allowed
")
if
@$args
;
$self
->
usage_error
("
No args allowed
")
if
@$args
;
return
1
;
return
1
;
}
}
sub
execute
{
sub
execute
{
my
(
$self
,
$opt
,
$args
)
=
@_
;
my
(
$self
,
$opt
,
$args
)
=
@_
;
if
(
$opt
->
{
target_version
})
{
if
(
$opt
->
{
target_version
})
{
...
...
This diff is collapsed.
Click to expand it.
t/03-info.t
+
10
−
1
View file @
9d6fa761
use
v5
.36
;
use
v5
.36
;
use
Test::
Cmd
;
use
Test::
Cmd
;
use
Test::
More
tests
=>
1
2
;
use
Test::
More
tests
=>
1
5
;
use
Path::
Tiny
;
use
Path::
Tiny
;
my
$perl
=
$^X
;
my
$perl
=
$^X
;
my
$testapp
=
Test::
Cmd
->
new
(
my
$testapp
=
Test::
Cmd
->
new
(
...
@@ -28,6 +28,7 @@ user: lza
...
@@ -28,6 +28,7 @@ user: lza
_CFG_
_CFG_
# tests
# tests
note
"
help check
";
foreach
my
$param
("
help info
",
"
info -h
",
"
info --help
")
{
foreach
my
$param
("
help info
",
"
info -h
",
"
info --help
")
{
$testapp
->
run
(
args
=>
$param
);
$testapp
->
run
(
args
=>
$param
);
#say "STDOUT:",$testapp->stdout;
#say "STDOUT:",$testapp->stdout;
...
@@ -43,4 +44,12 @@ like($testapp->stdout, qr/^6\.\d\.\d{1,2}$/, 'ta-tool elasticsearch version, std
...
@@ -43,4 +44,12 @@ like($testapp->stdout, qr/^6\.\d\.\d{1,2}$/, 'ta-tool elasticsearch version, std
like
(
$testapp
->
stderr
,
qr/^$/
,
'
ta-tool elasticsearch version, stderr
');
like
(
$testapp
->
stderr
,
qr/^$/
,
'
ta-tool elasticsearch version, stderr
');
is
(
$?
>>
8
,
0
,
'
ta-tool elasticsearch version, exit status
');
is
(
$?
>>
8
,
0
,
'
ta-tool elasticsearch version, exit status
');
$testapp
->
run
(
args
=>
'
info --elasticsearch-host localhost --target-version
');
#say "STDOUT:",$testapp->stdout;
#say "STDERR:",$testapp->stderr;
like
(
$testapp
->
stdout
,
qr/^$/
,
'
ta-tool elasticsearch version, stdout
');
like
(
$testapp
->
stderr
,
qr/^Hint: override local config/
,
'
ta-tool elasticsearch version, stderr
');
is
(
$?
>>
8
,
111
,
'
ta-tool elasticsearch version, exit status
');
1
;
1
;
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