Skip to content

Commit 24f2117

Browse files
committed
repl: Simplify
1 parent 7539976 commit 24f2117

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

repl/main.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ do_parse_command_line(int argc, char** argv)
9696
opt<cow_string> path;
9797
cow_vector<Value> args;
9898

99-
// Check for some common options before calling `getopt()`.
10099
if(argc > 1) {
100+
// Check for some common options before calling `getopt()`.
101101
if(::strcmp(argv[1], "--help") == 0)
102102
do_print_help_and_exit(argv[0]);
103103

@@ -108,7 +108,6 @@ do_parse_command_line(int argc, char** argv)
108108
// Parse command-line options.
109109
int ch;
110110
while((ch = ::getopt(argc, argv, "+hIiO::Vv")) != -1) {
111-
// Identify a single option.
112111
switch(ch) {
113112
case 'h':
114113
help = true;
@@ -126,8 +125,8 @@ do_parse_command_line(int argc, char** argv)
126125
if(!optarg || (optarg[0] < '0') || (optarg[0] > '9') || optarg[1])
127126
exit_printf(exit_invalid_argument,
128127
"%s: `-O` requires an integer argument between 0 and 9.", argv[0]);
129-
else
130-
optimize = optarg[0] - '0';
128+
129+
optimize = optarg[0] - '0';
131130
continue;
132131

133132
case 'V':

0 commit comments

Comments
 (0)