| #!/bin/sh |
| |
| function usage() { |
| echo |
| echo Available commands: |
| for command in $(ls /Applications/NDN.app/Contents/Helpers/ 2>/dev/null); do |
| echo " $command" |
| done |
| for command in $(ls /Applications/NDN.app/Contents/Resources/bin/ 2>/dev/null); do |
| echo " $command" |
| done |
| } |
| |
| if [[ $# -eq 0 ]]; then |
| echo ERROR: No command is specified |
| usage |
| exit 1 |
| fi |
| |
| if [[ -f /Applications/NDN.app/Contents/Helpers/"$1" ]]; then |
| /Applications/NDN.app/Contents/Helpers/"$@" |
| elif [[ -f /Applications/NDN.app/Contents/Resources/bin/"$1" ]]; then |
| /Applications/NDN.app/Contents/Resources/bin/"$@" |
| else |
| echo ERROR: Unknown is specified |
| usage |
| exit 1 |
| fi |