Internet Sharing: I just need a WLAN
This is not a programmatic but a manual solution.

Go to System Preferences → Network and check Show Wi-Fi status in menu bar.



Now click on the Wi-Fi icon shown in the menu bar and select Create Network....





Supply network name in the dialogue box shown (the default name assigned is the computer name set under System Preferences → Sharing).