* fix: usage goes into CLI of course, and put CLI proc. also in pisi-install

This commit is contained in:
Eray Özkural
2005-06-10 11:48:04 +00:00
parent e24d55815a
commit f4931ef29c
3 changed files with 42 additions and 11 deletions
+6 -6
View File
@@ -4,15 +4,16 @@
# python standard library
from os.path import basename
from specfile import SpecFile
from fetcher import Fetcher
# import archive
# import pisipackage
# import pisiutils # patch, fileutils?
import pisiconfig
import util
from pisibuild import PisiBuild
def usage(progname = "pisi-build"):
print """
Usage:
%s [options] package-name.pspec
""" %(progname)
def main():
import sys
import getopt
@@ -44,7 +45,6 @@ def main():
else:
pspec = args[0]
# doing the real job... vs. vs...
pb = PisiBuild(pspec)
util.information("Building PISI package for: %s" % pb.packageName)
+36
View File
@@ -1,3 +1,39 @@
#! /usr/bin/python
# -*- python -*-
def usage(progname = "pisi-install"):
print """
Usage:
%s [options] package-name.pspec
""" %(progname)
def main():
import sys
import getopt
# wrapper for usage(progname) function
help = lambda: usage(sys.argv[0])
# getopt magic
try:
opts, args = getopt.getopt(sys.argv[1:],"h",["help"])
except getopt.GetoptError:
help()
sys.exit(1)
for opt, arg in opts:
if opt == "-h":
help()
sys.exit(1)
# package filename
packagefn = ""
# TODO: We accept only one pspec file (at a time) currently,
# but pisi-build may build many packages (pspecs given in order)
# sequentially.
if len(args) != 1:
help()
raise PisiBuildError, "pisi-install excepts one (and only one) pspec file currently"
else:
packagefn = args[0]
-5
View File
@@ -34,8 +34,3 @@ class PisiBuild:
fetch = Fetcher(self.archiveUri)
fetch.fetch()
def usage(progname = "pisi-build"):
print """
Usage:
%s [options] package-name.pspec
""" %(progname)