From b72ad5892c30f10f5bf843a8a46ae8d99d5c8a0c Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Thu, 22 Dec 2022 01:38:49 +0900 Subject: [PATCH] fix: Added cfg in help_template --- src/builder/debug_asserts.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/builder/debug_asserts.rs b/src/builder/debug_asserts.rs index dff70e30..bfebbb4c 100644 --- a/src/builder/debug_asserts.rs +++ b/src/builder/debug_asserts.rs @@ -359,6 +359,13 @@ pub(crate) fn assert_app(cmd: &Command) { cmd.get_name(), "`{unified}` template variable was removed in clap3, use `{options}` instead" ); + #[cfg(feature = "unstable-v5")] + assert!( + !help_template.to_string().contains("{bin}"), + "Command {}: {}", + cmd.get_name(), + "`{bin}` template variable was removed in clap5, use `{name}` instead" + ) } cmd._panic_on_missing_help(cmd.is_help_expected_set());