1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-31 02:14:10 +02:00

- make 'results' output less noisy

- add parseargs() to simplify argument handling
- clean up some unused code
This commit is contained in:
Dr. Peter Poeml
2006-05-11 07:27:50 +00:00
parent 81deb97562
commit 03ca18dbb8
2 changed files with 26 additions and 44 deletions

View File

@@ -61,7 +61,7 @@ def main():
print ''.join(d)
elif cmd == 'co':
elif cmd == 'co' or cmd == 'checkout':
try:
project = sys.argv[2]
@@ -84,11 +84,7 @@ def main():
elif cmd == 'st' or cmd == 'status':
if len(sys.argv) > 2:
args = sys.argv[2:]
else:
args = [ os.curdir ]
#print args
args = parseargs()
for arg in args:
@@ -118,7 +114,12 @@ def main():
elif cmd == 'add':
filenames = sys.argv[2:]
if len(sys.argv) < 3:
print '%s requires at least one argument' % cmd
sys.exit(1)
filenames = parseargs()
for filename in filenames:
if not os.path.exists(filename):
print "file '%s' does not exist" % filename
@@ -128,10 +129,7 @@ def main():
print 'A ', filename
elif cmd == 'addremove':
if len(sys.argv) > 2:
args = sys.argv[2:]
else:
args = [ os.curdir ]
args = parseargs()
for arg in args:
@@ -164,11 +162,7 @@ def main():
elif cmd == 'ci' or cmd == 'checkin':
if len(sys.argv) > 2:
args = sys.argv[2:]
else:
args = [ os.curdir ]
#print args
args = parseargs()
for arg in args:
@@ -216,11 +210,7 @@ def main():
elif cmd == 'up' or cmd == 'update':
if len(sys.argv) > 2:
args = sys.argv[2:]
else:
args = [ os.curdir ]
#print args
args = parseargs()
for arg in args:
@@ -289,12 +279,12 @@ def main():
elif cmd == 'rm' or cmd == 'delete':
if len(sys.argv) > 2:
args = sys.argv[2:]
else:
if len(sys.argv) < 3:
print '%s requires at least one argument' % cmd
sys.exit(1)
args = parseargs()
for arg in args:
olddir = os.getcwd()