dry-cli-help 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dry/cli/help/screens/command.rb +6 -1
- data/lib/dry/cli/help/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf20fa0aacf131ed2906f0db379bc73dff9e6f73d106e9748f9db3efb589892c
|
|
4
|
+
data.tar.gz: 2407d232a6fc663f175431e8c907b1352e6ec13cda833a64530ea1f53e58b58c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaf06bce6593191d6fe7ef465df68afd6679877e1b412f8c8a654c04420b24229268c8a82a4ac9766e3d063a4b34c790636ea2aa15de77327bb291ae131755d8
|
|
7
|
+
data.tar.gz: 9c790e6b9b235577b2f92ffacf0f6648c4164ceaa00192f343e1dcb2aeae93326368f9bdace5c90763acc14fcc70411010306141881d778bcf8201142c1e7ffc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.5.1] - 2026-09-21
|
|
4
|
+
|
|
5
|
+
- An empty example, `example [""]`, no longer raises `NoMethodError` and takes the whole help screen with it. It prints the program name on its own, which is what a command that runs with no arguments means by it.
|
|
6
|
+
|
|
3
7
|
## [0.5.0] - Unreleased
|
|
4
8
|
|
|
5
9
|
- The `dry-cli` dependency no longer pins a version range; any release satisfies it.
|
|
@@ -55,10 +55,15 @@ module Dry
|
|
|
55
55
|
|
|
56
56
|
# Examples align among themselves: a full command line is longer than
|
|
57
57
|
# any option, and would push every other description off to the right.
|
|
58
|
+
#
|
|
59
|
+
# An empty example is how a command says "run me with nothing at
|
|
60
|
+
# all", and String#split answers [] for it, so `line` is nil and only
|
|
61
|
+
# the program name is left to print.
|
|
58
62
|
def render_examples
|
|
59
63
|
rows = command.examples.map do |example|
|
|
60
64
|
line, comment = example.split(" # ", 2)
|
|
61
|
-
|
|
65
|
+
term = [prog_name, line&.strip].reject { it.nil? || it.empty? }.join(" ")
|
|
66
|
+
Row.new(term: term, text: comment&.strip,
|
|
62
67
|
term_style: :example, text_style: :example_comment)
|
|
63
68
|
end
|
|
64
69
|
section(:examples, format.definitions(rows, format.column_for(rows)))
|
data/lib/dry/cli/help/version.rb
CHANGED