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
3831e227
Commit
3831e227
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta_frontend] Wraps help text at 80 chars
parent
7f1556b8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmdline/CtaAdminCmdParse.cpp
+14
-5
14 additions, 5 deletions
cmdline/CtaAdminCmdParse.cpp
with
14 additions
and
5 deletions
cmdline/CtaAdminCmdParse.cpp
+
14
−
5
View file @
3831e227
...
...
@@ -35,6 +35,9 @@ std::string CmdHelp::short_help() const {
std
::
string
CmdHelp
::
help
()
const
{
const
int
INDENT
=
4
;
const
int
WRAP_MARGIN
=
80
;
std
::
string
help
=
m_cmd_short
+
'/'
+
m_cmd_long
;
for
(
auto
sc_it
=
m_sub_cmd
.
begin
();
sc_it
!=
m_sub_cmd
.
end
();
++
sc_it
)
{
...
...
@@ -53,18 +56,24 @@ std::string CmdHelp::help() const {
// Per-subcommand help
for
(
auto
sc_it
=
m_sub_cmd
.
begin
();
sc_it
!=
m_sub_cmd
.
end
();
++
sc_it
)
{
std
::
string
cmd_
name
=
*
sc_it
;
cmd_
name
.
resize
(
max_sub_cmd
->
size
(),
' '
)
;
help
+=
'\t'
+
cmd_name
;
std
::
string
cmd_
line
(
INDENT
,
' '
)
;
cmd_
line
+=
*
sc_it
;
cmd_line
.
resize
(
INDENT
+
max_sub_cmd
->
size
(),
' '
)
;
auto
key
=
cmd_key_t
{
cmdLookup
.
at
(
m_cmd_short
),
subcmdLookup
.
at
(
*
sc_it
)
};
auto
options
=
cmdOptions
.
at
(
key
);
for
(
auto
op_it
=
options
.
begin
();
op_it
!=
options
.
end
();
++
op_it
)
{
help
+=
op_it
->
help
();
if
(
cmd_line
.
size
()
+
op_it
->
help
().
size
()
>
WRAP_MARGIN
)
{
help
+=
cmd_line
+
'\n'
;
cmd_line
=
std
::
string
(
INDENT
+
max_sub_cmd
->
size
(),
' '
);
}
cmd_line
+=
op_it
->
help
();
}
help
+=
'\n'
;
help
+=
cmd_line
+
'\n'
;
}
return
help
;
...
...
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