summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/app.py3
-rw-r--r--yarns/implementations.yarn2
-rw-r--r--yarns/noncore-plugins.yarn18
3 files changed, 22 insertions, 1 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index 8fd52a46..f5871d17 100644
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -427,9 +427,12 @@ class Morph(cliapp.Application):
text = '%s\n\n%s' % (usage, description)
self.output.write(text)
elif topic in extensions.list_extensions():
+ definitions_repo = morphlib.definitions_repo.open(
+ '.', False, self)
name, kind = os.path.splitext(topic)
try:
with extensions.get_extension_filename(
+ definitions_repo,
name,
kind + '.help', executable=False) as fname:
with open(fname, 'r') as f:
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 794c7c52..f4abb190 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -676,7 +676,7 @@ them, so they can be added to the end of the implements section.
Implementations sections for reading error messages
===================================================
- IMPLEMENTS THEN the (branch|build|checkout|deploy|edit|init) error message includes the string "(.*)"
+ IMPLEMENTS THEN the (branch|build|checkout|deploy|edit|init|help) error message includes the string "(.*)"
grep "$MATCH_2" "$DATADIR/result-$MATCH_1"
IMPLEMENTS for test file and directory handling
diff --git a/yarns/noncore-plugins.yarn b/yarns/noncore-plugins.yarn
index 1cf4fd90..39c0d7af 100644
--- a/yarns/noncore-plugins.yarn
+++ b/yarns/noncore-plugins.yarn
@@ -252,3 +252,21 @@ Oh, and the one line should contain no spaces, either.
then
die "stderr is not empty"
fi
+
+Showing help for extensions
+---------------------------
+
+ SCENARIO morph shows help for extensions
+ WHEN morph help is run for an extension
+ THEN morph succeeded
+
+ SCENARIO morph help shows an error for a non-existent extension
+ WHEN morph help is run for a non-existent extension
+ THEN morph failed
+ AND the help error message includes the string "ERROR: Unknown subcommand or extension"
+
+ IMPLEMENTS WHEN morph help is run for an extension
+ attempt_morph help tar.write > "$DATADIR/stdout" 2> "$DATADIR/stderr"
+
+ IMPLEMENTS WHEN morph help is run for a non-existent extension
+ attempt_morph help nonexistent.write > "$DATADIR/stdout" 2> "$DATADIR/stderr"