test.sh 989 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. # g.parser demo script
  3. #%Module
  4. #% description: g.parser test script
  5. #% keywords: keyword1, keyword2
  6. #%End
  7. #%flag
  8. #% key: f
  9. #% description: A flag
  10. #%end
  11. #%option
  12. #% key: raster
  13. #% type: string
  14. #% gisprompt: old,cell,raster
  15. #% description: Raster input map
  16. #% required : yes
  17. #%end
  18. #%option
  19. #% key: vector
  20. #% type: string
  21. #% gisprompt: old,vector,vector
  22. #% description: Vector input map
  23. #% required : yes
  24. #%end
  25. #%option
  26. #% key: option1
  27. #% type: string
  28. #% description: An option
  29. #% required : yes
  30. #%end
  31. if [ -z "$GISBASE" ] ; then
  32. echo "You must be in GRASS GIS to run this program." 1>&2
  33. exit 1
  34. fi
  35. if [ "$1" != "@ARGS_PARSED@" ] ; then
  36. exec $GISBASE/bin/g.parser "$0" "$@"
  37. fi
  38. #add your code here
  39. echo ""
  40. if [ $GIS_FLAG_f -eq 1 ] ; then
  41. echo "Flag -f set"
  42. else
  43. echo "Flag -f not set"
  44. fi
  45. echo "Value of GIS_OPT_option1: '$GIS_OPT_option1'"
  46. echo "Value of GIS_OPT_raster: '$GIS_OPT_raster'"
  47. echo "Value of GIS_OPT_vect: '$GIS_OPT_vector'"
  48. #add your code here