#!/usr/bin/env python
import sys
import locale
from logging import warn
try:
	locale.setlocale(locale.LC_ALL, '')
except locale.Error:
	warn('Error setting locale (eg. Invalid locale)')

## PATH ##

import sys

if sys.argv[1:2] == ['--python-fallback']:
	# Hack to let the OCaml front-end chain the Python.
	# Using "python -m" isn't safe, because it adds the current directory
	# to PYTHONPATH.
	from zeroinstall.cmd import main
	main(sys.argv[2:])
else:
	from zeroinstall.injector.cli import main
	main(sys.argv[1:])
