shell dot on steroids https://pagure.io/shellfu

simple.sh 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. #
  3. # Some arbitrary text like License and authourship info
  4. # this time the text is somewhat longer and has its own
  5. # paragraphs.
  6. #
  7. # This is an example of such paragraph, which does span
  8. # more than one, more than two, in fact, actually about
  9. # three lines.
  10. #
  11. #
  12. # A test module with functions, variables and long docstring
  13. #
  14. # This one has even the module docstring longer as it can then
  15. # form a testcase of such module.
  16. #
  17. # # Usage #
  18. #
  19. # This module is only used for testing of docstring parsing
  20. # and object (by which we mean *function* or *variable*, not
  21. # some OOP stuff) printing functionality.
  22. #
  23. # The internal format is Markdown-ish, but is parsed as plain
  24. # text. But still, as an example we will try to use some
  25. # common Markdown. For example, this:
  26. #
  27. # #!/bin/bash
  28. # #
  29. #
  30. # is like first two lines of this file look like.
  31. #
  32. #
  33. #
  34. # A test variable with a short docstring
  35. #
  36. SIMPLE_LIMIT=42
  37. #
  38. # A test variable with a long docstring
  39. #
  40. # Not really long but the longer version (header plus
  41. # the rest)
  42. #
  43. SIMPLE_DEBUG=${SIMPLE_DEBUG:-false}
  44. simple_foo() {
  45. #
  46. # A test function with a short docstring
  47. #
  48. local foo=$1
  49. local bar
  50. bar=$foo
  51. echo $foo
  52. }
  53. simple_other_function() {
  54. #
  55. # A test function with a long docstring
  56. #
  57. # Not really long but the longer version (header plus
  58. # the rest)
  59. #
  60. :
  61. }