use POSIX basename() and strip ".exe" extension before inspecting argv[0] to select function.