shBrushBash.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * SyntaxHighlighter
  3. * http://alexgorbatchev.com/SyntaxHighlighter
  4. *
  5. * SyntaxHighlighter is donationware. If you are using it, please donate.
  6. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
  7. *
  8. * @version
  9. * 3.0.83 (July 02 2010)
  10. *
  11. * @copyright
  12. * Copyright (C) 2004-2010 Alex Gorbatchev.
  13. *
  14. * @license
  15. * Dual licensed under the MIT and GPL licenses.
  16. */
  17. ;(function()
  18. {
  19. // CommonJS
  20. typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  21. function Brush()
  22. {
  23. var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le';
  24. var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
  25. 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
  26. 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
  27. 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
  28. 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
  29. 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
  30. 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
  31. 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
  32. 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
  33. 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
  34. 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
  35. 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
  36. 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
  37. 'vi watch wc whereis which who whoami Wget xargs yes'
  38. ;
  39. this.regexList = [
  40. { regex: /^#!.*$/gm, css: 'preprocessor bold' },
  41. { regex: /\/[\w-\/]+/gm, css: 'plain' },
  42. { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
  43. { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
  44. { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
  45. { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
  46. { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
  47. ];
  48. }
  49. Brush.prototype = new SyntaxHighlighter.Highlighter();
  50. Brush.aliases = ['bash', 'shell'];
  51. SyntaxHighlighter.brushes.Bash = Brush;
  52. // CommonJS
  53. typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
  54. })();