mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
5f4583b52d
This reverts commit 3d8f98c395
.
In addition to the issues mentioned on the GitHub page for this commit,
it also broke the CentOS 7 build.
Note one can locally test the CentOS 7 build via:
./docker/docker_run_tests.sh ./docker/centos7.Dockerfile
24 lines
537 B
C++
24 lines
537 B
C++
// Print help message for the specified command.
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include "print_help.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <cstring>
|
|
|
|
#include "common.h"
|
|
|
|
#define CMD_LEN 1024
|
|
|
|
#define HELP_ERR "Could not show help message\n"
|
|
|
|
void print_help(const char *c, int fd) {
|
|
char cmd[CMD_LEN];
|
|
int printed = snprintf(cmd, CMD_LEN, "fish -c '__fish_print_help %s >&%d'", c, fd);
|
|
|
|
if (printed < CMD_LEN && system(cmd) == -1) {
|
|
write_loop(2, HELP_ERR, std::strlen(HELP_ERR));
|
|
}
|
|
}
|