slackdescgen 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. #============HEADER==========================================================|
  3. #AUTHOR
  4. # Jefferson Rocha
  5. #
  6. #PROGRAM
  7. # SLACKDESCGEN
  8. #============================================================================|
  9. _USAGE()
  10. {
  11. cat <<EOF
  12. slackdescgen <OPTIONS>
  13. WHAT IS?
  14. slackdescgen is a simple inline TEMPLATE generator for slack-desc.
  15. USAGE:
  16. -g, --generate
  17. NAME: Name of package.
  18. SMALL DESC: Small description of your package.
  19. HOMEPAGE: Homepage of your package.
  20. -h, --help
  21. Print this manual.
  22. SIMPLE MODE:
  23. Do not switch the order!!!! <name> <small desc> <homepage>
  24. slackdescgen --generate slackdescgen 'slackdesckgen simple generate template slack-desc' slackdesc.github.io
  25. Created by Jefferson Rocha BUGS? <lrcjefferson@gmail.com>
  26. EOF
  27. }
  28. _GENERATE()
  29. {
  30. cat > slack-desc <<END
  31. # HOW TO EDIT THIS FILE:
  32. # The "handy ruler" below makes it easier to edit a package description. Line
  33. # up the first '|' above the ':' following the base package name, and the '|' on
  34. # the right side marks the last column you can put a character in. You must make
  35. # exactly 11 lines for the formatting to be correct. It's also customary to
  36. # leave one space after the ':'.
  37. |-----handy-ruler------------------------------------------------------|
  38. $appname: $appname ($short_description)
  39. $appname:
  40. $appname:
  41. $appname:
  42. $appname:
  43. $appname:
  44. $appname:
  45. $appname:
  46. $appname:
  47. $appname: $homepage
  48. $appname:
  49. END
  50. echo "Template 'slack-desc' created!"
  51. }
  52. #====MAIN
  53. case $1 in
  54. -g|-generate)
  55. shift
  56. appname="$1"
  57. shift
  58. short_description="$1"
  59. shift
  60. homepage="$1"
  61. _GENERATE
  62. ;;
  63. -h|--help) _USAGE ;;
  64. *) _USAGE ;;
  65. esac