Ejemplo n.º 1
0
 void HelpScreen()
 {
     Header();
     QCol.Red("Usage: "); QCol.Yellow(qstr.StripDir(qstr.StripExt(MKL.MyExe))); QCol.Magenta(" [<switches>] "); QCol.Cyan("[<files/folder>]\n\n");
     QCol.Cyan("-p\t"); QCol.Yellow("Page based output\n");
     QCol.Cyan("-all\t"); QCol.Yellow("List all found files, regardless of them being hidden or not (Hidden in Unix terms, so starting with a .)\n");
     QCol.Cyan("-ansi\t"); QCol.Yellow("Use ANSI in stead of standard Windows Console colors (default on non-Windows systems)\n");
     QCol.Cyan("-w\t"); QCol.Yellow("Wide view\n");
     QCol.Cyan("-s\t"); QCol.Yellow("Recursive\n");
     QCol.Cyan("-b\t"); QCol.Yellow("Show file names only without any info\n\n");
     QCol.Green($"{MKL.All()}\n\n");
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            try {
                MKL.Lic("Quick Neil - QuickNeil.cs", "GNU General Public License 3");
                MKL.Version("Quick Neil - QuickNeil.cs", "20.08.14");
                if (args.Length == 0)
                {
                    Head();
                    QCol.Cyan("Usage: ");
                    QCol.Yellow($"{qstr.StripAll(MKL.MyExe)} ");
                    QCol.Green("<script file> ");
                    QCol.Magenta("[<arguments>]\n\n");
                    QCol.White($"{MKL.All()}\n\n");
                    return;
                }
                else
                {
                    var addargs = new StringBuilder("{");
                    for (int i = 1; i < args.Length; i++)
                    {
                        if (i >= 2)
                        {
                            addargs.Append(", ");
                        }
                        var arg = args[i].Replace("\\", "\\\\");
                        for (int j = 0; j < 256; j++)
                        {
                            if (j < 32 || j > 120 || (char)j == '"')
                            {
                                arg = arg.Replace($"{(char)j}", $"\\{qstr.Right($"00{j}", 3)}");
                            }
                        }
                        addargs.Append($"\"{arg}\"");
                    }
                    addargs.Append("}");
                    Debug.WriteLine($"DBG:Argument array {addargs}");
                    //throw new Exception ($"Argument array {addargs}"); // debug only!
                    LoadScript(args[0], $"{addargs}");
                }
            } catch (Exception e) {
                QCol.QuickError(e.Message);
#if DEBUG
                QCol.Cyan("Traceback\n");
                QCol.White($"{e.StackTrace}\n");
#endif
            } finally {
                TrickyDebug.AttachWait();
            }
        }
        public static void Main(string[] getargs)
        {
#if DEBUG
            string[] args = { "C", "Test" };
#else
            string[] args = getargs;
#endif
            Dirry.C("$AppSupport"); // Just forces MKL to be properly set :P
            QOpen.Hello();
            qstr.Chr(1);
            Compile.Hi();
            MKL.Lic("DevLog Compiler - DevLogCompiler.cs", "GNU General Public License 3");
            MKL.Version("DevLog Compiler - DevLogCompiler.cs", "18.11.17");
            Console.WriteLine($"DevLog - version {MKL.Newest}");
            Console.WriteLine($"(c) Jeroen P. Broks 2018-20{qstr.Left(MKL.Newest,2)}");
#if DEBUG
            Console.WriteLine("\n\nWARNING! This is the debug version!\nAs the name suggests this build should be used for debugging purposes ONLY!\n");
#endif
            if (args.Length == 0)
            {
                Console.WriteLine("\n\n");
                Console.WriteLine("DevLogCompiler c <project> - Compiles Project Into Binary form");
                //Console.WriteLine("DevLogCompiler d <project> - Decompiles Project From Binary form back to text form");
                Console.WriteLine("DevlogCompiler v           - Full version information");
                return;
            }
            switch (args[0].ToUpper())
            {
            case "C": if (args.Length != 2)
                {
                    Console.WriteLine("Invalid command line input!"); return;
                }
                Compile.Go($"{WorkSpace}/Projects/{args[1]}");
                break;

            case "V": Console.WriteLine($"\n{MKL.All()}"); break;

            default: Console.WriteLine("Unknown command switch"); break;
            }
        }
Ejemplo n.º 4
0
 static public void Init()
 {
     MKL.Lic("Development Log - Command.cs", "GNU General Public License 3");
     MKL.Version("Development Log - Command.cs", "20.07.24");
     Commands["ANNOY"]        = Annoy;
     Commands["BYE"]          = Bye;
     Commands["SAY"]          = delegate(string yeah) { GUI.WriteLn(yeah, true); };
     Commands["F**K"]         = delegate { Annoy("Did your mother never teach you not to say such words?"); };
     Commands["YULERIA"]      = delegate { Annoy("Yuleria's rule of revenge:\nAn amateur kills people! A professional makes them suffer!"); };
     Commands["GLOBALCONFIG"] = GlobalConfig;
     Commands["USE"]          = delegate(string useme) { GUI.Use(useme); };
     Commands["SYSVARS"]      = delegate { if (CurrentProject == null)
                                           {
                                               GUI.WriteLn("No project!"); return;
                                           }
                                           foreach (string v in CurrentProject.Data.Vars())
                                           {
                                               GUI.WriteLn(v);
                                           }
     };
     Commands["VARS"] = delegate { if (CurrentProject == null)
                                   {
                                       GUI.WriteLn("No project!"); return;
                                   }
                                   foreach (string v in CurrentProject.Data.Vars())
                                   {
                                       if (qstr.Prefixed(v, "VAR."))
                                       {
                                           GUI.WriteLn(v);
                                       }
                                   }
     };
     Commands["LET"]    = LetVar;
     Commands["NEWTAG"] = NewTag;
     Commands["ADDTAG"] = NewTag;
     Commands["ADD"]    = AddEntry;
     Commands["GEN"]    = delegate { Export.Gen(); };
     Commands["ABOUT"]  = delegate {
         GUI.WriteLn($"This tool has been created and copyrighted by Jeroen P. Broks\nIs has been released under the terms of the GPL version 3\n\nCompiled on the next source files:\n\n{MKL.All()}");
     };
     Commands["CLH"]    = delegate { GUI.ClearHistory(); };
     Commands["CLS"]    = delegate { GUI.ClearConsole(); };
     Commands["PUSH"]   = delegate { GUI.WriteLn("Thanks to Ziggo I cannot push yet, but that comes later!"); };
     Commands["GO"]     = Go;
     Commands["UNLINK"] = Delete;
     Commands["DELETE"] = Delete;
     Commands["KILL"]   = Delete;
     Commands["RM"]     = Delete;
     Commands["REMOVE"] = Delete;
     Commands["DEL"]    = Delete;
     Commands["CREATE"] = Create;
     Commands["SAVE"]   = delegate { if (CurrentProject != null)
                                     {
                                         CurrentProject.SaveMe(); GUI.WriteLn("Saved!");
                                     }
                                     else
                                     {
                                         Annoy("No Project!");
                                     } };
     Commands["TAKE"] = Take;
     Commands["EDIT"] = delegate(string num) {
         if (CurrentProject == null)
         {
             Annoy("No Project!"); return;
         }
         var e = new dvEntry(CurrentProject, qstr.ToInt(num), true);
         if (e == null)
         {
             Annoy("Entry couldn't be accessed!"); return;
         }
         GUI.SetPrompt($"MODIFY {num} {e.Tag} {e.Pure}");
     };
     Commands["MODIFY"] = delegate(string str) {
         var args = str.Split(' ');
         if (CurrentProject == null)
         {
             Annoy("No Project!"); return;
         }
         if (args.Length < 3)
         {
             Annoy("Modify syntax error!"); return;
         }
         var num = qstr.ToInt(args[0]);
         var e   = new dvEntry(CurrentProject, num, true);
         if (e == null)
         {
             Annoy("Entry couldn't be accessed!"); return;
         }
         var tag = args[1].ToUpper();
         if (!CurrentProject.GotTag(tag))
         {
             Annoy($"There's no tag: {tag}"); return;
         }
         var sb = new System.Text.StringBuilder();
         e.Tag = tag;
         for (int i = 2; i < args.Length; ++i)
         {
             sb.Append($"{args[i]} ");
         }
         e.Pure = sb.ToString().Trim();
         GUI.UpdateEntries(CurrentProject.HighestRecordNumber - 200, CurrentProject.HighestRecordNumber);
     };
 }
Ejemplo n.º 5
0
 static void NoStuff()
 {
     Head();
     Console.WriteLine(MKL.All());
     Console.WriteLine($"Usage: {qstr.StripAll(MyExe)} <WendickaAppFile> [<parameters>]");
 }
Ejemplo n.º 6
0
 private static void InitArgs()
 {
     JCR6_lzma.Init();
     MyArgs.CrBool("version", false);
     MyArgs.CrBool("help", false);
     MyArgs.CrBool("h", false);
     if (!MyArgs.Parse(true))
     {
         throw new Exception("Invalid input");
     }
     if (MyArgs.GetBool("version"))
     {
         Head();
         Console.WriteLine(MKL.All(true));
         Environment.Exit(0);
     }
     if (MyArgs.GetBool("h") || MyArgs.GetBool("help"))
     {
         Head();
         Console.ForegroundColor = ConsoleColor.Cyan;
         Console.Write("MKL_Update ");
         Console.ForegroundColor = ConsoleColor.Yellow;
         Console.WriteLine("[<dir1> [<dir2> [<dir3>....]]]");
         Console.ForegroundColor = ConsoleColor.Gray;
         Console.WriteLine("\tUpdates the MKL data and license blocks in given directories. If none given, the current directory will be done");
         Console.ForegroundColor = ConsoleColor.Cyan;
         Console.Write("MKL_Update ");
         Console.ForegroundColor = ConsoleColor.Magenta;
         Console.WriteLine("-h");
         Console.ForegroundColor = ConsoleColor.Cyan;
         Console.Write("MKL_Update ");
         Console.ForegroundColor = ConsoleColor.Magenta;
         Console.WriteLine("-help");
         Console.ForegroundColor = ConsoleColor.Gray;
         Console.WriteLine("\tShows this help text");
         Console.ForegroundColor = ConsoleColor.Cyan;
         Console.Write("MKL_Update ");
         Console.ForegroundColor = ConsoleColor.Magenta;
         Console.WriteLine("-version");
         Console.ForegroundColor = ConsoleColor.Gray;
         Console.WriteLine("\tShows detailed version information");
         Console.WriteLine("\n\n\nThe next programming languages are supported by MKL_Update");
         foreach (string k in JCR.Entries.Keys)
         {
             if (qstr.Prefixed(k, "EXT/"))
             {
                 TGINI T = GINI.ReadFromLines(JCR.ReadLines(k));
                 // Console.WriteLine($"{k} => {qstr.Prefixed(k, "EXT/")}"); // debug line
                 Console.ForegroundColor = ConsoleColor.Yellow;
                 Console.BackgroundColor = ConsoleColor.Blue;
                 Console.Write(k.ToLower());
                 for (int i = k.Length; i < 30; i++)
                 {
                     Console.Write(" ");
                 }
                 Console.BackgroundColor = ConsoleColor.Black;
                 Console.ForegroundColor = ConsoleColor.Magenta;
                 Console.WriteLine($" {T.C("LANGUAGE")}");
             }
         }
         Console.ResetColor();
         Environment.Exit(0);
     }
 }