diff options
author | Daniel Mueller <deso@posteo.net> | 2020-10-04 09:46:31 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-10-11 17:07:08 -0700 |
commit | f65b150049ec9dc5ff2500d7e54c464d530f2e66 (patch) | |
tree | bd63618507dee5ec142c606662356a61fd8c1d00 /src/tests/run.rs | |
parent | 8cf63c6790192c30c81294e7a940d470bf061cbf (diff) | |
download | nitrocli-f65b150049ec9dc5ff2500d7e54c464d530f2e66.tar.gz nitrocli-f65b150049ec9dc5ff2500d7e54c464d530f2e66.tar.bz2 |
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.
Diffstat (limited to 'src/tests/run.rs')
-rw-r--r-- | src/tests/run.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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(()) } |