In fact, the program "emulator" is just a wrapper for the real emulator-qemu, such as emulator-arm or emulator-x86. The "emulator" you invoked will collect the arguments you typed in and find the proper emulator-qemu to execute.
The problem you met is that you did not explicitly describe which image/avd you want to start. You can either using the argument "@avd YOUR-AVD_NAME" or "ANDROID_PRODUCT_OUT" environment variable to set the dir where your avd is placed. BTW, avd dir contains some files to describe how this device looks like.
". build/envsetup.sh" is the script that set the environment variables for the Android build process. So it is easy to understand why "ANDROID_PRODUCT_OUT" will be set at that time. Its default value should be "PATH/TO/ANDROID/out/target/product/generic".
PS: If you want to know more, you can refer to the source file: "PATH/TO/ANDROID/external/qemu/android/main-emulator.c". You can find the emulator main there.