~mil/mepo

5b75b59c28f38d0dcc6afb67545e768316fe8786 — Miles Alan 2 years ago 11c6ad6
Fix cancel functionality for overpass script
1 files changed, 4 insertions(+), 5 deletions(-)

M scripts/mepo_ui_menu_search_overpass.sh
M scripts/mepo_ui_menu_search_overpass.sh => scripts/mepo_ui_menu_search_overpass.sh +4 -5
@@ 3,7 3,6 @@ DISPLAYNAME=" POI Search: via Overpass"
HOTKEY=b

OPTIONS='
  Cancel
  Bars:          [amenity=bar]
  Restraunt:     [amenity=restaurant]
  Pizza:         [amenity=restaurant] [cuisine=italian]


@@ 16,15 15,15 @@ OPTIONS='

main() {
  SCOPE="$(
    echo "$OPTIONS" |
    echo -e "Cancel\n$OPTIONS" |
      sed 's/^ *//' |
      sed 's/ *$//' |
      grep . | 
      PROMPT="Bbox POI Search" mepo_ui_helper_menu.sh |
      cut -d ' ' -f2- |
      tr '\n' ' '
      PROMPT="Bbox POI Search" mepo_ui_helper_menu.sh
  )"
  [ "$SCOPE" = "Cancel" ] && exit
  SCOPE="$(echo $SCOPE | cut -d ' ' -f2- | tr '\n' ' ')"

  if [ -z "$SCOPE" ]; then
    echo "Invalid search query for overpass: $SCOPE" >&2
    exit 1