Skip to content

Commit

Permalink
No of files to show is now configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Aug 10, 2012
1 parent 3787f80 commit 372b5fc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/python/moa/plugin/system/fileset.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def _preformatFile(f):

@moa.args.doNotLog
@moa.args.needsJob
@moa.args.argument('-n', '--no_files', type=int, help="No filesets to show (default 10)", default=10)
@moa.args.addFlag('-a', '--all', help="Show all filesets")
@moa.args.command
def files(job, args):
"""
Expand Down Expand Up @@ -135,8 +137,13 @@ def files(job, args):
#rearrange the files into logical sets
nofiles = len(job.data.filesets[(fsets + fmaps)[0]].files)
moa.ui.fprint("")

for i in range(min(5, nofiles)):

if args.all:
toprint = nofiles
else:
toprint = min(args.no_files, nofiles)

for i in range(toprint):
thisSet = []
for j, fsid in enumerate((fsets + fmaps)):
files = job.data.filesets[fsid].files
Expand All @@ -161,3 +168,5 @@ def files(job, args):
moa.ui.fprint(_preformatFile(files[i]), f='jinja', newline=False)
moa.ui.fprint("")
moa.ui.fprint("")
if toprint < nofiles:
moa.ui.fprint("... and %d more" % (nofiles - toprint))

0 comments on commit 372b5fc

Please sign in to comment.