print_help takes a bool

master
Daniel Kolesa 2015-12-26 14:29:55 +01:00
parent 649745d33c
commit c21d6dc054
1 changed files with 4 additions and 4 deletions

View File

@ -490,8 +490,8 @@ struct ObState: CsState {
}); });
} }
int print_help(int v) { int print_help(bool error) {
ostd::Stream &os = v ? ostd::err : ostd::out; ostd::Stream &os = error ? ostd::err : ostd::out;
os.writeln("Usage: ", progname, " [options] [action]\n", os.writeln("Usage: ", progname, " [options] [action]\n",
"Options:\n" "Options:\n"
" -C DIRECTORY\tChange to DIRECTORY before running.\n", " -C DIRECTORY\tChange to DIRECTORY before running.\n",
@ -500,7 +500,7 @@ struct ObState: CsState {
" -j N\t\tSpecify the number of jobs to use (default: 1).\n" " -j N\t\tSpecify the number of jobs to use (default: 1).\n"
" -e STR\tEvaluate a string instead of a file.\n" " -e STR\tEvaluate a string instead of a file.\n"
" -E\t\tIgnore environment variables."); " -E\t\tIgnore environment variables.");
return v; return error;
} }
}; };
@ -550,7 +550,7 @@ int main(int argc, char **argv) {
break; break;
} }
default: default:
return os.print_help(1); return os.print_help(true);
} }
} else { } else {
posarg = i; posarg = i;