[SERVER-9172] Command line parameters --help and --version should be processed before others Created: 29/Mar/13  Updated: 30/Nov/15  Resolved: 30/Nov/15

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.0.8, 2.2.3, 2.4.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ernie Hershey Assignee: Unassigned
Resolution: Done Votes: 0
Labels: commandline, configuration, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

tested in osx and rhel 6.3


Issue Links:
Related
related to SERVER-8510 Move command line parsing into MONGO_... Closed
is related to SERVER-6900 Windows Service: --install output sho... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

mongod --version --logpath /var/log/mongod/mongod.log
mongod --help --logpath /var/log/mongod/mongod.log

With logpath configured in /etc/mongod.conf:
mongod --version --config /etc/mongod.conf
mongod --help --config /etc/mongod.conf

Participants:

 Description   

These command line calls should print version or help info instead of writing it to the log file.

mongod --version --logpath /var/log/mongod/mongod.log
mongod --help --logpath /var/log/mongod/mongod.log

(or with logpath configured in /etc/mongod.conf)

mongod --version --config /etc/mongod.conf
mongod --help --config /etc/mongod.conf



 Comments   
Comment by Tad Marshall [ 08/Aug/13 ]

luke.lovett Try testing the versions that are listed in "Affects Version/s: 2.0.8, 2.2.3, 2.4.1". If you can't verify the bug in one or all of them, then something is funny.

If you can verify that the bug existed in those versions but is no longer there, you could try to figure out what commit fixed it (probably not worth the trouble, but perhaps interesting) or just mark the bug as Gone Away. If you figure out what commit fixed it, you could add a comment with "Fixed by commit xxx" so that readers can see the change that fixed it.

Comment by Luke Lovett [ 08/Aug/13 ]

I wasn't able to replicate this.

mongod --help --logpath /var/log/mongod/mongod.log
and
mongod --logpath /var/log/mongod/mongod.log --help

both produce the expected output on stdout for me, without creating a logfile. Same goes with --version.

I'm using the following version of mongod:
db version v2.4.5
Thu Aug 8 17:40:00.306 git version: a2ddc68ba7c9cee17bfe69ed840383ec3506602b

Am I missing something?

Generated at Thu Feb 08 03:19:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.