From ac5ea03a16f71fa7305e931619a132e150c83c29 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sun, 4 Oct 2020 09:46:31 -0700 Subject: Display available extensions in the help text With recent changes we are able to execute user-provided extensions through the program. However, discoverability is arguably lacking, because nitrocli provides no insight into what extensions are available to begin with. This patch changes this state of affairs by listing available extensions in the help text. --- src/tests/run.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tests/run.rs') diff --git a/src/tests/run.rs b/src/tests/run.rs index e4bbb28..1dae166 100644 --- a/src/tests/run.rs +++ b/src/tests/run.rs @@ -300,7 +300,11 @@ print("success") } let path = ext_dir.path().as_os_str().to_os_string(); - let out = Nitrocli::new().path(path).handle(&["ext"])?; + // Make sure that the extension appears in the help text. + let out = Nitrocli::new().path(&path).handle(&["--help"])?; + assert!(out.contains("ext Run the ext extension\n"), out); + // And, of course, that we can invoke it. + let out = Nitrocli::new().path(&path).handle(&["ext"])?; assert_eq!(out, "success\n"); Ok(()) } -- cgit v1.2.1