Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
dCache
cta
Commits
e9c5f24e
Commit
e9c5f24e
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-admin] Fixes some command line short options
parent
895e1586
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmdline/CtaAdminCmd.cpp
+1
-9
1 addition, 9 deletions
cmdline/CtaAdminCmd.cpp
cmdline/CtaAdminCmdParse.cpp
+2
-2
2 additions, 2 deletions
cmdline/CtaAdminCmdParse.cpp
cmdline/CtaAdminCmdParse.hpp
+10
-10
10 additions, 10 deletions
cmdline/CtaAdminCmdParse.hpp
with
13 additions
and
21 deletions
cmdline/CtaAdminCmd.cpp
+
1
−
9
View file @
e9c5f24e
...
...
@@ -290,15 +290,7 @@ void CtaAdminCmd::throwUsage(const std::string &error_txt) const
{
// Command has been set: show command-specific help
// Reverse lookup of long command name
std
::
string
longcmd
;
for
(
auto
map_it
=
cmdLookup
.
begin
();
map_it
!=
cmdLookup
.
end
();
++
map_it
)
{
if
(
admincmd
==
map_it
->
second
&&
map_it
->
first
.
length
()
>
longcmd
.
length
())
{
longcmd
=
map_it
->
first
;
}
}
help
<<
m_execname
<<
' '
<<
longcmd
<<
cmdHelp
.
at
(
admincmd
).
help
();
help
<<
m_execname
<<
' '
<<
cmdHelp
.
at
(
admincmd
).
help
();
}
throw
std
::
runtime_error
(
help
.
str
());
...
...
This diff is collapsed.
Click to expand it.
cmdline/CtaAdminCmdParse.cpp
+
2
−
2
View file @
e9c5f24e
...
...
@@ -48,7 +48,7 @@ void Option::validateCmd(const AdminCmd &admincmd) const
}
}
throw
std
::
runtime_error
((
m_type
==
Option
::
OPT_CMD
?
m_help_txt
:
m_long_opt
)
+
" is obligatory."
);
throw
std
::
runtime_error
(
"Missing option: "
+
(
m_type
==
Option
::
OPT_CMD
?
m_help_txt
:
m_long_opt
));
}
...
...
@@ -86,7 +86,7 @@ std::string CmdHelp::help() const
[](
std
::
string
const
&
lhs
,
std
::
string
const
&
rhs
)
{
return
lhs
.
size
()
<
rhs
.
size
();
});
// Terminate with a colon if there are subcommands to follow
m_help_full
+=
(
max_sub_cmd
!=
m_sub_cmd
.
end
())
?
":
\n
"
:
"
\n
"
;
m_help_full
+=
(
max_sub_cmd
!=
m_sub_cmd
.
end
())
?
cmd_line
+
":
\n
"
:
"
\n
"
;
// Add optional additional help
m_help_full
+=
m_help_extra
;
...
...
This diff is collapsed.
Click to expand it.
cmdline/CtaAdminCmdParse.hpp
+
10
−
10
View file @
e9c5f24e
...
...
@@ -383,11 +383,11 @@ const Option opt_lbp { Option::OPT_BOOL, "--lbp",
const
Option
opt_logicallibrary
{
Option
::
OPT_STR
,
"--logicallibrary"
,
"-l"
,
" <logical_library_name>"
};
const
Option
opt_logicallibrary_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <logical_library_name>"
,
"--logicallibrary"
};
const
Option
opt_maxdrivesallowed
{
Option
::
OPT_UINT
,
"--maxdrivesallowed"
,
"-d"
,
" <max
D
rives
A
llowed>"
};
const
Option
opt_minarchiverequestage
{
Option
::
OPT_UINT
,
"--minarchiverequestage"
,
"--aa"
,
" <min
R
equest
A
ge>"
};
const
Option
opt_minretrieverequestage
{
Option
::
OPT_UINT
,
"--minretrieverequestage"
,
"--ra"
,
" <min
R
equest
A
ge>"
};
const
Option
opt_mountpolicy
{
Option
::
OPT_STR
,
"--mountpolicy"
,
"-u"
,
" <mountpolicy_name>"
};
const
Option
opt_mountpolicy_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <mountpolicy_name>"
,
const
Option
opt_maxdrivesallowed
{
Option
::
OPT_UINT
,
"--maxdrivesallowed"
,
"-d"
,
" <max
_d
rives
_a
llowed>"
};
const
Option
opt_minarchiverequestage
{
Option
::
OPT_UINT
,
"--minarchiverequestage"
,
"--aa"
,
" <min
_r
equest
_a
ge>"
};
const
Option
opt_minretrieverequestage
{
Option
::
OPT_UINT
,
"--minretrieverequestage"
,
"--ra"
,
" <min
_r
equest
_a
ge>"
};
const
Option
opt_mountpolicy
{
Option
::
OPT_STR
,
"--mountpolicy"
,
"-u"
,
" <mount
_
policy_name>"
};
const
Option
opt_mountpolicy_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <mount
_
policy_name>"
,
"--mountpolicy"
};
const
Option
opt_number_of_files
{
Option
::
OPT_UINT
,
"--nbfiles"
,
"-n"
,
" <number_of_files_per_tape>"
};
const
Option
opt_number_of_files_alias
{
Option
::
OPT_UINT
,
"--number"
,
"-n"
,
" <number_of_files>"
,
...
...
@@ -396,7 +396,7 @@ const Option opt_output { Option::OPT_STR, "--output",
const
Option
opt_owner
{
Option
::
OPT_STR
,
"--owner"
,
"-o"
,
" <owner>"
};
const
Option
opt_partialfiles
{
Option
::
OPT_UINT
,
"--partial"
,
"-p"
,
" <number_of_files_per_tape>"
};
const
Option
opt_partialtapes
{
Option
::
OPT_UINT
,
"--partialtapesnumber"
,
"-p"
,
" <number_of_partial_tapes>"
};
const
Option
opt_path
{
Option
::
OPT_STR
,
"--path"
,
"-p"
,
" <fullpath>"
};
const
Option
opt_path
{
Option
::
OPT_STR
,
"--path"
,
"-p"
,
" <full
_
path>"
};
const
Option
opt_retrievepriority
{
Option
::
OPT_UINT
,
"--retrievepriority"
,
"--rp"
,
" <priority_value>"
};
const
Option
opt_size
{
Option
::
OPT_UINT
,
"--size"
,
"-s"
,
" <file_size>"
};
const
Option
opt_storageclass
{
Option
::
OPT_STR
,
"--storageclass"
,
"-s"
,
" <storage_class_name>"
};
...
...
@@ -404,7 +404,7 @@ const Option opt_storageclass_alias { Option::OPT_STR, "--name",
"--storageclass"
};
const
Option
opt_summary
{
Option
::
OPT_FLAG
,
"--summary"
,
"-S"
,
""
};
const
Option
opt_tag
{
Option
::
OPT_STR
,
"--tag"
,
"-t"
,
" <tag_name>"
};
const
Option
opt_tapepool
{
Option
::
OPT_STR
,
"--tapepool"
,
"-
n
"
,
" <tapepool_name>"
};
const
Option
opt_tapepool
{
Option
::
OPT_STR
,
"--tapepool"
,
"-
t
"
,
" <tapepool_name>"
};
const
Option
opt_tapepool_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <tapepool_name>"
,
"--tapepool"
};
const
Option
opt_username
{
Option
::
OPT_STR
,
"--username"
,
"-u"
,
" <user_name>"
};
...
...
@@ -480,10 +480,10 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = {
{{
AdminCmd
::
CMD_SHRINK
,
AdminCmd
::
SUBCMD_NONE
},
{
opt_tapepool
}},
{{
AdminCmd
::
CMD_SHOWQUEUES
,
AdminCmd
::
SUBCMD_NONE
},
{
opt_header
.
optional
()
}},
{{
AdminCmd
::
CMD_STORAGECLASS
,
AdminCmd
::
SUBCMD_ADD
},
{
opt_instance
,
opt_storageclass
,
opt_copynb
,
opt_comment
}},
{
opt_instance
,
opt_storageclass
_alias
,
opt_copynb
,
opt_comment
}},
{{
AdminCmd
::
CMD_STORAGECLASS
,
AdminCmd
::
SUBCMD_CH
},
{
opt_instance
,
opt_storageclass
,
opt_copynb
.
optional
(),
opt_comment
.
optional
()
}},
{{
AdminCmd
::
CMD_STORAGECLASS
,
AdminCmd
::
SUBCMD_RM
},
{
opt_instance
,
opt_storageclass
}},
{
opt_instance
,
opt_storageclass
_alias
,
opt_copynb
.
optional
(),
opt_comment
.
optional
()
}},
{{
AdminCmd
::
CMD_STORAGECLASS
,
AdminCmd
::
SUBCMD_RM
},
{
opt_instance
,
opt_storageclass
_alias
}},
{{
AdminCmd
::
CMD_STORAGECLASS
,
AdminCmd
::
SUBCMD_LS
},
{
opt_header
.
optional
()
}},
{{
AdminCmd
::
CMD_TAPE
,
AdminCmd
::
SUBCMD_ADD
},
{
opt_vid
,
opt_logicallibrary
,
opt_tapepool
,
opt_capacity
,
opt_disabled
,
opt_full
,
opt_comment
.
optional
()
}},
...
...
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