summaryrefslogtreecommitdiff
path: root/src/nproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nproc.c')
-rw-r--r--src/nproc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nproc.c b/src/nproc.c
index a93ee536..5bd6610d 100644
--- a/src/nproc.c
+++ b/src/nproc.c
@@ -1,5 +1,5 @@
/* nproc - print the number of processors.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
#include "system.h"
#include "error.h"
#include "nproc.h"
+#include "quote.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no 'g' prefix). */
@@ -113,6 +114,12 @@ main (int argc, char **argv)
}
}
+ if (argc != optind)
+ {
+ error (0, 0, _("extra operand %s"), quote (argv[optind]));
+ usage (EXIT_FAILURE);
+ }
+
nproc = num_processors (mode);
if (ignore < nproc)