"sar -1 -f" output was different than "sar -f -1" one.
So now enforce options check more aggressively: You cannot enter a day
offset (eg. -1) together with option -f (which tells here to use the
standard sa datafile).
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
}
else if (!strcmp(argv[opt], "-f")) {
- if (from_file[0]) {
+ if (from_file[0] || day_offset) {
/* Input file already specified */
usage(argv[0]);
}
(strlen(argv[opt]) < 4) &&
!strncmp(argv[opt], "-", 1) &&
(strspn(argv[opt] + 1, DIGITS) == (strlen(argv[opt]) - 1))) {
+ if (from_file[0] || day_offset) {
+ /* Input file already specified */
+ usage(argv[0]);
+ }
day_offset = atoi(argv[opt++] + 1);
}