mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-19 03:52:44 +08:00
![Kurtis Rader](/assets/img/avatar_default.png)
Remove the "make iwyu" build target. Move the functionality into the recently introduced lint.fish script. Fix a lot, but not all, of the include-what-you-use errors. Specifically, it fixes all of the IWYU errors on my OS X server but only removes some of them on my Ubuntu 14.04 server. Fixes #2957
34 lines
646 B
C++
34 lines
646 B
C++
/** \file print_help.c
|
|
Print help message for the specified command
|
|
*/
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "print_help.h"
|
|
|
|
#define CMD_LEN 1024
|
|
|
|
#define HELP_ERR "Could not show help message\n"
|
|
|
|
/* defined in common.h */
|
|
ssize_t write_loop(int fd, const char *buff, size_t count);
|
|
|
|
|
|
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)
|
|
{
|
|
if ((system(cmd) == -1))
|
|
{
|
|
write_loop(2, HELP_ERR, strlen(HELP_ERR));
|
|
}
|
|
|
|
}
|
|
|
|
}
|