Пример #1
0
 static void l_message(Lua.CharPtr pname, Lua.CharPtr msg)
 {
     if (pname != null)
     {
         Lua.fprintf(Lua.stderr, "%s: ", pname);
     }
     Lua.fprintf(Lua.stderr, "%s\n", msg);
     Lua.fflush(Lua.stderr);
 }
Пример #2
0
 static void usage(Lua.CharPtr message)
 {
     if (message[0] == '-')
     {
         Lua.fprintf(Lua.stderr, "%s: unrecognized option " + Lua.LUA_QS + "\n", progname, message);
     }
     else
     {
         Lua.fprintf(Lua.stderr, "%s: %s\n", progname, message);
     }
     Lua.fprintf(Lua.stderr,
                 "usage: %s [options] [filenames].\n" +
                 "Available options are:\n" +
                 "  -        process stdin\n" +
                 "  -l       list\n" +
                 "  -o name  output to file " + Lua.LUA_QL("name") + " (default is \"%s\")\n" +
                 "  -p       parse only\n" +
                 "  -s       strip debug information\n" +
                 "  -v       show version information\n" +
                 "  --       stop handling options\n",
                 progname, Output);
     Environment.Exit(Lua.EXIT_FAILURE);
 }
Пример #3
0
 static void cannot(Lua.CharPtr what)
 {
     Lua.fprintf(Lua.stderr, "%s: cannot %s %s: %s\n", progname, what, output, Lua.strerror(Lua.errno()));
     Environment.Exit(Lua.EXIT_FAILURE);
 }
Пример #4
0
        static Lua.CharPtr progname = PROGNAME;            /* actual program name */

        static void fatal(Lua.CharPtr message)
        {
            Lua.fprintf(Lua.stderr, "%s: %s\n", progname, message);
            Environment.Exit(Lua.EXIT_FAILURE);
        }