summaryrefslogtreecommitdiffstats
path: root/src/modules/jobs.rs
diff options
context:
space:
mode:
authorKevin Song <chipbuster@users.noreply.github.com>2019-08-12 20:41:59 -0700
committerMatan Kushner <hello@matchai.me>2019-08-12 23:41:59 -0400
commita87c0750ccd10a157f19486b926b788dc1cf7338 (patch)
treeb3846e039223e18fef99354a362870f7e6ebe61b /src/modules/jobs.rs
parent1d6ce77a81a43b8cbffdd7b595859697ad27e3e4 (diff)
fix: Fix issue with jobs and extra whitespace on MacOS with BSD… (#145)
MacOS wc has a habit of leaving nasty spaces in the output, which was messing up our argparser. To fix, quote the output from the jobs command, then have Rust trim out whitespace in the jobs module before parsing.
Diffstat (limited to 'src/modules/jobs.rs')
-rw-r--r--src/modules/jobs.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/modules/jobs.rs b/src/modules/jobs.rs
index 4a89a1af3..649c2f8b0 100644
--- a/src/modules/jobs.rs
+++ b/src/modules/jobs.rs
@@ -17,6 +17,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let num_of_jobs = arguments
.value_of("jobs")
.unwrap_or("0")
+ .trim()
.parse::<i64>()
.ok()?;
if num_of_jobs == 0 {