Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
68c1765a
Commit
68c1765a
authored
Aug 18, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Simplify help handling by removing an if-else if-else block.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8a8a753c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
reg.c
programs/reg/reg.c
+13
-9
No files found.
programs/reg/reg.c
View file @
68c1765a
...
...
@@ -902,23 +902,32 @@ static const WCHAR addW[] = {'a','d','d',0};
static
const
WCHAR
deleteW
[]
=
{
'd'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
static
const
WCHAR
queryW
[]
=
{
'q'
,
'u'
,
'e'
,
'r'
,
'y'
,
0
};
static
enum
operations
get_operation
(
const
WCHAR
*
str
)
static
enum
operations
get_operation
(
const
WCHAR
*
str
,
int
*
op_help
)
{
if
(
!
lstrcmpiW
(
str
,
addW
))
{
*
op_help
=
STRING_ADD_USAGE
;
return
REG_ADD
;
}
if
(
!
lstrcmpiW
(
str
,
deleteW
))
{
*
op_help
=
STRING_DELETE_USAGE
;
return
REG_DELETE
;
}
if
(
!
lstrcmpiW
(
str
,
queryW
))
{
*
op_help
=
STRING_QUERY_USAGE
;
return
REG_QUERY
;
}
return
REG_INVALID
;
}
int
wmain
(
int
argc
,
WCHAR
*
argvW
[])
{
int
i
,
op
,
ret
;
int
i
,
op
,
op_help
,
ret
;
BOOL
show_op_help
=
FALSE
;
static
const
WCHAR
switchVAW
[]
=
{
'v'
,
'a'
,
0
};
static
const
WCHAR
switchVEW
[]
=
{
'v'
,
'e'
,
0
};
...
...
@@ -939,7 +948,7 @@ int wmain(int argc, WCHAR *argvW[])
return
0
;
}
op
=
get_operation
(
argvW
[
1
]);
op
=
get_operation
(
argvW
[
1
]
,
&
op_help
);
if
(
op
==
REG_INVALID
)
{
...
...
@@ -959,12 +968,7 @@ int wmain(int argc, WCHAR *argvW[])
}
else
if
(
show_op_help
)
{
if
(
op
==
REG_ADD
)
output_message
(
STRING_ADD_USAGE
);
else
if
(
op
==
REG_DELETE
)
output_message
(
STRING_DELETE_USAGE
);
else
output_message
(
STRING_QUERY_USAGE
);
output_message
(
op_help
);
return
0
;
}
...
...
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