Alexander Afanasyev | 9c45c64 | 2017-03-18 15:29:42 -0700 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | function usage() { |
| 4 | echo |
| 5 | echo Available commands: |
| 6 | for command in $(ls /Applications/NDN.app/Contents/Helpers/ 2>/dev/null); do |
| 7 | echo " $command" |
| 8 | done |
| 9 | for command in $(ls /Applications/NDN.app/Contents/Resources/bin/ 2>/dev/null); do |
| 10 | echo " $command" |
| 11 | done |
| 12 | } |
| 13 | |
| 14 | if [[ $# -eq 0 ]]; then |
| 15 | echo ERROR: No command is specified |
| 16 | usage |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | if [[ -f /Applications/NDN.app/Contents/Helpers/"$1" ]]; then |
| 21 | /Applications/NDN.app/Contents/Helpers/"$@" |
| 22 | elif [[ -f /Applications/NDN.app/Contents/Resources/bin/"$1" ]]; then |
| 23 | /Applications/NDN.app/Contents/Resources/bin/"$@" |
| 24 | else |
| 25 | echo ERROR: Unknown is specified |
| 26 | usage |
| 27 | exit 1 |
| 28 | fi |