commit:     7c96e5adcdc1a0db7d33492a60bd76a17a228e04
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 29 12:36:00 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 12:37:21 2025 +0000
URL:        https://gitweb.gentoo.org/proj/steve.git/commit/?id=7c96e5ad

Report an error on positional arguments

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 steve.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/steve.cxx b/steve.cxx
index 4ebea86..41e5cfa 100644
--- a/steve.cxx
+++ b/steve.cxx
@@ -509,6 +509,12 @@ int main(int argc, char **argv)
                }
        }
 
+       if (argv[optind]) {
+               std::print(stderr, "{}: unexpected positional arguments\n", 
argv[0]);
+               std::print(stderr, steve_usage, argv[0]);
+               return 1;
+       }
+
        if (state.min_jobs > state.jobs) {
                std::print(stderr, "--min-jobs ({}) must be smaller than --jobs 
({})\n",
                                state.min_jobs, state.jobs);

Reply via email to