#include "../../include/c4script/c4script.h"
#include <cstdio>
#include <cstring>
#include <getopt.h>
Go to the source code of this file.
|
int | usage (const char *argv0) |
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 30 of file C4ScriptMain.cpp.
33 return usage(argv[0]);
36 char *runstring =
nullptr;
40 static option long_options[] =
42 {
"check", no_argument,
nullptr,
'c'},
43 {
"execute", required_argument,
nullptr,
'e'},
44 {
nullptr, 0,
nullptr, 0}
48 int c = getopt_long(argc, argv,
"ce:", long_options, &option_index);
59 return usage(argv[0]);
65 if (argc - optind != 0)
66 return usage(argv[0]);
74 if (argc - optind != 1)
75 return usage(argv[0]);
int usage(const char *argv0)
int c4s_checkfile(const char *filename)
int c4s_checkstring(const char *script)
int c4s_runstring(const char *script)
int c4s_runfile(const char *filename)
References c4s_checkfile(), c4s_checkstring(), c4s_runfile(), c4s_runstring(), and usage().
◆ usage()
int usage |
( |
const char * |
argv0 | ) |
|
Definition at line 24 of file C4ScriptMain.cpp.
26 fprintf(stderr,
"Usage:\n%s -e <script>\n%s <file>\n", argv0, argv0);
Referenced by main().