forked from OctaForge/OctaBuild
print_help takes a bool
This commit is contained in:
parent
649745d33c
commit
c21d6dc054
8
main.cc
8
main.cc
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue