mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
print_help: simplify function to always use stdout
It's only called in two places and always uses stdout.
This commit is contained in:
parent
ffb6168221
commit
3b55563769
4 changed files with 5 additions and 5 deletions
|
@ -341,7 +341,7 @@ int main(int argc, char *argv[]) {
|
|||
break;
|
||||
}
|
||||
case 'h': {
|
||||
print_help("fish_indent", 1);
|
||||
print_help("fish_indent");
|
||||
exit(0);
|
||||
}
|
||||
case 'v': {
|
||||
|
|
|
@ -312,7 +312,7 @@ static bool parse_flags(int argc, char **argv, bool *continuous_mode, bool *verb
|
|||
break;
|
||||
}
|
||||
case 'h': {
|
||||
print_help("fish_key_reader", 1);
|
||||
print_help("fish_key_reader");
|
||||
exit(0);
|
||||
}
|
||||
case 'v': {
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
#define HELP_ERR "Could not show help message\n"
|
||||
|
||||
void print_help(const char *c, int fd) {
|
||||
void print_help(const char *c) {
|
||||
char cmd[CMD_LEN];
|
||||
int printed = snprintf(cmd, CMD_LEN, "fish -c '__fish_print_help %s >&%d'", c, fd);
|
||||
int printed = snprintf(cmd, CMD_LEN, "fish -c '__fish_print_help %s'", c);
|
||||
|
||||
if (printed < CMD_LEN && system(cmd) == -1) {
|
||||
write_loop(2, HELP_ERR, std::strlen(HELP_ERR));
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
#define FISH_PRINT_HELP_H
|
||||
|
||||
/// Print help message for the specified command.
|
||||
void print_help(const char *cmd, int fd);
|
||||
void print_help(const char *cmd);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue