* remove komutunu ekle
* help'ler koy komutlar icin ayri ayri * nedir
This commit is contained in:
@@ -60,7 +60,7 @@ Legend:
|
|||||||
+ implement file uri
|
+ implement file uri
|
||||||
+ extend the modules dealing with files accordingly
|
+ extend the modules dealing with files accordingly
|
||||||
- multi-package dependency analysis (eray)
|
- multi-package dependency analysis (eray)
|
||||||
- design a package operation planner
|
+ design a package operation planner
|
||||||
- install operation
|
- install operation
|
||||||
- upgrade operation
|
- upgrade operation
|
||||||
- ui module improvements
|
- ui module improvements
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ build
|
|||||||
index
|
index
|
||||||
info
|
info
|
||||||
install
|
install
|
||||||
|
remove
|
||||||
updatedb
|
updatedb
|
||||||
|
|
||||||
Use \"%prog help <command>\" for help on a specific subcommand.
|
Use \"%prog help <command>\" for help on a specific subcommand.
|
||||||
@@ -55,7 +56,8 @@ class Parser(OptionParser):
|
|||||||
|
|
||||||
class PisiCLI(object):
|
class PisiCLI(object):
|
||||||
|
|
||||||
commands = ["help", "build", "info", "install", "index", "updatedb"]
|
commands = ["help", "build", "info", "install",
|
||||||
|
"remove", "index", "updatedb"]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# first construct a parser for common options
|
# first construct a parser for common options
|
||||||
@@ -141,6 +143,11 @@ class PisiCLI(object):
|
|||||||
|
|
||||||
|
|
||||||
# FIX: her komut için ayrı help
|
# FIX: her komut için ayrı help
|
||||||
|
|
||||||
|
help_help = """help: display help
|
||||||
|
usage: help
|
||||||
|
help <command>"""
|
||||||
|
|
||||||
def help_opts(self):
|
def help_opts(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -149,8 +156,14 @@ class PisiCLI(object):
|
|||||||
print usage
|
print usage
|
||||||
return
|
return
|
||||||
|
|
||||||
self.parser.print_help()
|
if command !="":
|
||||||
|
print self.__getattribute__(command + '_help')
|
||||||
|
else:
|
||||||
|
print self.__getattribute__(self.args[0] + '_help')
|
||||||
|
|
||||||
|
info_help = """info: display information about a package
|
||||||
|
usage: info <package> ...
|
||||||
|
"""
|
||||||
def info_opts(self):
|
def info_opts(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -166,6 +179,8 @@ class PisiCLI(object):
|
|||||||
metadata, files = pisi.install.get_pkg_info(arg)
|
metadata, files = pisi.install.get_pkg_info(arg)
|
||||||
print metadata.package
|
print metadata.package
|
||||||
|
|
||||||
|
index_help = """index: Index PISI files in a given directory"""
|
||||||
|
|
||||||
def index_opts(self):
|
def index_opts(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -181,6 +196,8 @@ class PisiCLI(object):
|
|||||||
print 'Indexing only a single directory supported'
|
print 'Indexing only a single directory supported'
|
||||||
self.die()
|
self.die()
|
||||||
|
|
||||||
|
install_help = """install: install PISI packages"""
|
||||||
|
|
||||||
def install_opts(self):
|
def install_opts(self):
|
||||||
self.parser.add_option("", "--test", action="store_true",
|
self.parser.add_option("", "--test", action="store_true",
|
||||||
default=True, help="xxxx")
|
default=True, help="xxxx")
|
||||||
@@ -191,6 +208,8 @@ class PisiCLI(object):
|
|||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
installhelper.install(arg)
|
installhelper.install(arg)
|
||||||
|
|
||||||
|
build_help = """build: compile PISI packages"""
|
||||||
|
|
||||||
def build_opts(self):
|
def build_opts(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -201,6 +220,20 @@ class PisiCLI(object):
|
|||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
buildhelper.build(arg, self.authInfo)
|
buildhelper.build(arg, self.authInfo)
|
||||||
|
|
||||||
|
remove_help = """remove: remove PISI packages"""
|
||||||
|
|
||||||
|
def remove_opts(self):
|
||||||
|
self.parser.add_option("", "--test", action="store_true",
|
||||||
|
default=True, help="xxxx")
|
||||||
|
|
||||||
|
def remove(self):
|
||||||
|
if not self.args:
|
||||||
|
self.help("install")
|
||||||
|
for arg in self.args:
|
||||||
|
pisi.install.remove(arg)
|
||||||
|
|
||||||
|
updatedb_help = """updatedb: update source and package databases"""
|
||||||
|
|
||||||
def updatedb_opts(self):
|
def updatedb_opts(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user