diff --git a/bin/tito b/bin/tito deleted file mode 100755 index 75a4993..0000000 --- a/bin/tito +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008,2009 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# - -import sys - -from tito.cli import CLI - -if __name__ == "__main__": - try: - CLI().main(sys.argv[1:]) - except KeyboardInterrupt: - pass diff --git a/setup.py b/setup.py index f616b0a..ebccde6 100755 --- a/setup.py +++ b/setup.py @@ -37,9 +37,15 @@ setup( 'blessed' ], + # automatically create console scripts + entry_points={ + 'console_scripts': [ + 'tito = tito.cli:main', + ], + }, + # non-python scripts go here scripts=[ - 'bin/tito', 'bin/generate-patches.pl' ], diff --git a/src/tito/cli.py b/src/tito/cli.py index 94ab517..2df1119 100644 --- a/src/tito/cli.py +++ b/src/tito/cli.py @@ -887,3 +887,15 @@ CLI_MODULES = { "report": ReportModule, "init": InitModule, } + + +def main(): + """Command line's entry point.""" + try: + CLI().main(sys.argv[1:]) + except KeyboardInterrupt: + pass + + +if __name__ == "__main__": + main() diff --git a/tito.spec b/tito.spec index f7e2bf9..078c5b5 100644 --- a/tito.spec +++ b/tito.spec @@ -80,7 +80,6 @@ git. %prep %setup -q -n tito-%{version} -sed -i 1"s|#!.*|#!%{ourpythonbin}|" bin/tito %build %{ourpythonbin} setup.py build