@@ -149,7 +149,14 @@ int main(int argc, char* const argv[]) {
149
149
std::cerr << params.progname () << " : " << _ (" Only one file is allowed when extracting to stdout" ) << std::endl;
150
150
returnCode = EXIT_FAILURE;
151
151
} else {
152
- int w = filesCount > 9 ? filesCount > 99 ? 3 : 2 : 1 ;
152
+ int w = [=]() {
153
+ if (filesCount > 9 ) {
154
+ if (filesCount > 99 )
155
+ return 3 ;
156
+ return 2 ;
157
+ }
158
+ return 1 ;
159
+ }();
153
160
int n = 1 ;
154
161
for (const auto & file : params.files_ ) {
155
162
// If extracting to stdout then ignore verbose
@@ -1038,19 +1045,15 @@ int Params::getopt(int argc, char* const Argv[]) {
1038
1045
std::cerr << progname () << " : " << _ (" At least one file is required\n " );
1039
1046
rc = 1 ;
1040
1047
}
1041
- if (rc == 0 && !cmdFiles_.empty ()) {
1042
- // Parse command files
1043
- if (!parseCmdFiles (modifyCmds_, cmdFiles_)) {
1044
- std::cerr << progname () << " : " << _ (" Error parsing -m option arguments\n " );
1045
- rc = 1 ;
1046
- }
1048
+ // Parse command files
1049
+ if (rc == 0 && !cmdFiles_.empty () && !parseCmdFiles (modifyCmds_, cmdFiles_)) {
1050
+ std::cerr << progname () << " : " << _ (" Error parsing -m option arguments\n " );
1051
+ rc = 1 ;
1047
1052
}
1048
- if (rc == 0 && !cmdLines_.empty ()) {
1049
- // Parse command lines
1050
- if (!parseCmdLines (modifyCmds_, cmdLines_)) {
1051
- std::cerr << progname () << " : " << _ (" Error parsing -M option arguments\n " );
1052
- rc = 1 ;
1053
- }
1053
+ // Parse command lines
1054
+ if (rc == 0 && !cmdLines_.empty () && !parseCmdLines (modifyCmds_, cmdLines_)) {
1055
+ std::cerr << progname () << " : " << _ (" Error parsing -M option arguments\n " );
1056
+ rc = 1 ;
1054
1057
}
1055
1058
if (rc == 0 && (!cmdFiles_.empty () || !cmdLines_.empty ())) {
1056
1059
// We'll set them again, after reading the file
@@ -1060,15 +1063,15 @@ int Params::getopt(int argc, char* const Argv[]) {
1060
1063
std::cerr << progname () << " : " << _ (" -l option can only be used with extract or insert actions\n " );
1061
1064
rc = 1 ;
1062
1065
}
1063
- if (!suffix_.empty () && !( action_ == Action::insert) ) {
1066
+ if (!suffix_.empty () && action_ != Action::insert) {
1064
1067
std::cerr << progname () << " : " << _ (" -S option can only be used with insert action\n " );
1065
1068
rc = 1 ;
1066
1069
}
1067
- if (timestamp_ && !( action_ == Action::rename ) ) {
1070
+ if (timestamp_ && action_ != Action::rename ) {
1068
1071
std::cerr << progname () << " : " << _ (" -t option can only be used with rename action\n " );
1069
1072
rc = 1 ;
1070
1073
}
1071
- if (timestampOnly_ && !( action_ == Action::rename ) ) {
1074
+ if (timestampOnly_ && action_ != Action::rename ) {
1072
1075
std::cerr << progname () << " : " << _ (" -T option can only be used with rename action\n " );
1073
1076
rc = 1 ;
1074
1077
}
0 commit comments