Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Ignore jobs value when the value is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Jan 18, 2017
1 parent 17fe268 commit 51eaf67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/arguments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ impl Args {
// If the second character exists, everything's OK.
let character = char_iter.next().ok_or_else(|| ParseErr::InvalidArgument(index-1))?;
if character == 'j' {
self.ncores = parse_jobs(argument, arguments.get(index), &mut index)?;
let val = parse_jobs(argument, arguments.get(index), &mut index)?;
if val != 0 { self.ncores = val; }
} else if character == 'n' {
max_args = parse_max_args(argument, arguments.get(index), &mut index)?;
} else if character != '-' {
Expand Down Expand Up @@ -146,8 +147,8 @@ impl Args {
},
"joblog-8601" => self.flags |= JOBLOG_8601,
"jobs" => {
let val = arguments.get(index).ok_or(ParseErr::JobsNoValue)?;
self.ncores = jobs::parse(val)?;
let val = jobs::parse(arguments.get(index).ok_or(ParseErr::JobsNoValue)?)?;
if val != 0 { self.ncores = val; }
index += 1;
},
"line-buffer" | "lb" => (),
Expand Down

0 comments on commit 51eaf67

Please sign in to comment.