mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
prevent enabled command fallback to Python when it's run without --help
Summary: I'm introducing a new Rust-only command implementation, and I never want it to fall back to Python help, even if it's run without a required option. Therefore, handle DisplayHelpOnMissingArgumentOrSubcommand as well as DisplayHelp. Reviewed By: fanzeyi Differential Revision: D44560239 fbshipit-source-id: 43c418da3c980a34a11277c82bf350822b0bc71b
This commit is contained in:
parent
c682ccc661
commit
56c1538580
@ -183,7 +183,8 @@ fn wrapper_main() -> Result<i32> {
|
||||
// UnknownArgument (whether or not --help was requested) and we
|
||||
// should fall back to Python.
|
||||
Err(e) => {
|
||||
if e.kind() == clap::ErrorKind::DisplayHelp
|
||||
if (e.kind() == clap::ErrorKind::DisplayHelp
|
||||
|| e.kind() == clap::ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand)
|
||||
&& should_use_rust_help(std::env::args(), &None).unwrap_or(false)
|
||||
{
|
||||
e.exit()
|
||||
|
Loading…
Reference in New Issue
Block a user