Build: implemented the environment switching (the --environment option).