Help

Displays TinyShell version, describes special keyboard commands and lists installed command plugins.

Command line interface

Syntax

  1. $ help

Arguments

This command takes no arguments.

Example

help.js

  1. /**
  2. * Help
  3. **/
  4. TinyShell.plugins.help = new Class({
  5. description: "Show help",
  6. run : function(t) {
  7. t.print("TinyShell:");
  8. t.print("Version "+TinyShell.version);
  9. t.print();
  10. t.print("Special keyboard actions:");
  11. t.print("UP ARROW Previous command");
  12. t.print("DOWN ARROW Next command");
  13. t.print("TAB Autocomplete");
  14. t.print("SHIFT+ENTER New line");
  15. t.print("SHIFT+UP ARROW Line up");
  16. t.print("SHIFT+DOWN ARROW Line down");
  17. t.print();
  18. t.print("Installed command plugins:");
  19. var plugs = [];
  20. for (plugin in TinyShell.plugins) plugs.push(plugin+this.repeat(" ", 19-plugin.length)+" "+$pick(new TinyShell.plugins[plugin]().description, "No description available"));
  21. plugs.sort();
  22. t.print(plugs.join("\n"));
  23. t.resume();
  24. },
  25. repeat : function ($s, $n) {
  26. r = "";
  27. for (var i = 0; i < $n; i++) r += $s;
  28. return r;
  29. }
  30. });

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>