aboutsummaryrefslogtreecommitdiffhomepage
path: root/print_help.c
diff options
context:
space:
mode:
Diffstat (limited to 'print_help.c')
-rw-r--r--print_help.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/print_help.c b/print_help.c
new file mode 100644
index 00000000..72344cde
--- /dev/null
+++ b/print_help.c
@@ -0,0 +1,22 @@
+
+/** \file print_help.c
+ Print help message for the specified command
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+
+
+#include "print_help.h"
+
+#define CMD_LEN 1024
+
+void print_help( 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 );
+
+}