We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe81090 commit 7abe2bfCopy full SHA for 7abe2bf
clap_complete/tests/testsuite/engine.rs
@@ -981,6 +981,24 @@ a_pos,c_pos"
981
);
982
}
983
984
+#[test]
985
+fn suggest_external_subcommand() {
986
+ let mut cmd = Command::new("dynamic")
987
+ .arg(clap::Arg::new("positional").value_parser(["pos1", "pos2", "pos3"]));
988
+
989
+ assert_data_eq!(
990
+ complete!(cmd, " [TAB]"),
991
+ snapbox::str![
992
+ "--help\tPrint help
993
+-h\tPrint help
994
+pos1
995
+pos2
996
+pos3
997
+"
998
+ ]
999
+ );
1000
+}
1001
1002
fn complete(cmd: &mut Command, args: impl AsRef<str>, current_dir: Option<&Path>) -> String {
1003
let input = args.as_ref();
1004
let mut args = vec![std::ffi::OsString::from(cmd.get_name())];
0 commit comments