Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
apk-tools
Commits
d035ef60
Commit
d035ef60
authored
Jun 30, 2013
by
Dubiousjim
Committed by
Timo Teräs
Jun 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apk: infrastructure for short-option-only synonyms
parent
bfa39f6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/apk.c
src/apk.c
+9
-8
No files found.
src/apk.c
View file @
d035ef60
...
...
@@ -111,13 +111,14 @@ static void print_usage(const char *cmd, const char *args, int num_opts,
int
i
,
j
;
indent
.
x
=
printf
(
"
\n
usage: apk %s"
,
cmd
)
-
1
;
for
(
i
=
0
;
i
<
num_opts
;
i
++
)
{
j
=
0
;
word
[
j
++
]
=
'['
;
j
+=
format_option
(
&
word
[
j
],
sizeof
(
word
)
-
j
,
&
opts
[
i
],
"|"
);
word
[
j
++
]
=
']'
;
apk_print_indented
(
&
indent
,
APK_BLOB_PTR_LEN
(
word
,
j
));
}
for
(
i
=
0
;
i
<
num_opts
;
i
++
)
if
(
opts
[
i
].
name
!=
NULL
)
{
j
=
0
;
word
[
j
++
]
=
'['
;
j
+=
format_option
(
&
word
[
j
],
sizeof
(
word
)
-
j
,
&
opts
[
i
],
"|"
);
word
[
j
++
]
=
']'
;
apk_print_indented
(
&
indent
,
APK_BLOB_PTR_LEN
(
word
,
j
));
}
if
(
args
!=
NULL
)
apk_print_indented
(
&
indent
,
APK_BLOB_STR
(
args
));
printf
(
"
\n
"
);
...
...
@@ -230,7 +231,7 @@ static void merge_options(struct option *opts, struct apk_option *ao, int num)
int
i
;
for
(
i
=
0
;
i
<
num
;
i
++
,
opts
++
,
ao
++
)
{
opts
->
name
=
ao
->
name
;
opts
->
name
=
ao
->
name
?:
""
;
opts
->
has_arg
=
ao
->
has_arg
;
opts
->
flag
=
NULL
;
opts
->
val
=
ao
->
val
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment