Skip to content

Commit 56c1538

Browse files
chadaustinfacebook-github-bot
authored andcommitted
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
1 parent c682ccc commit 56c1538

File tree

1 file changed

+2
-1
lines changed
  • eden/fs/cli_rs/edenfsctl/src

1 file changed

+2
-1
lines changed

eden/fs/cli_rs/edenfsctl/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ fn wrapper_main() -> Result<i32> {
183183
// UnknownArgument (whether or not --help was requested) and we
184184
// should fall back to Python.
185185
Err(e) => {
186-
if e.kind() == clap::ErrorKind::DisplayHelp
186+
if (e.kind() == clap::ErrorKind::DisplayHelp
187+
|| e.kind() == clap::ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand)
187188
&& should_use_rust_help(std::env::args(), &None).unwrap_or(false)
188189
{
189190
e.exit()

0 commit comments

Comments
 (0)