fail when passing non integer
This commit is contained in:
@@ -43,8 +43,11 @@ Simple implementation of head that keeps the header row.
|
||||
help="File(s) to be headed")
|
||||
opts=parser.parse_args()
|
||||
if not opts.lines:
|
||||
int(opts.file[0])
|
||||
opts.lines=int(opts.file.pop(0))
|
||||
try:
|
||||
int(opts.file[0])
|
||||
opts.lines=int(opts.file.pop(0))
|
||||
except:
|
||||
pass
|
||||
if not opts.lines:
|
||||
opts.lines=10
|
||||
return opts
|
||||
|
||||
Reference in New Issue
Block a user