localvault 1.11.2 → 1.11.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f7a9ef056579778ef2dabd22148af8fe8fbd19b2e0b4aefafde3c9eb6a454ee
4
- data.tar.gz: e5006419cb47849c63a7f4c123ba661e6c95bd2f93fe8ef3230faff2ab5fe7ec
3
+ metadata.gz: 57abcee5bdce8a863134e73333323eba61ed5d969f0675d2a0886f4c71f76a1d
4
+ data.tar.gz: 35114201fc535b678d90b50cc6b8876a6d589a2079750a1e2fd912fb7a32c903
5
5
  SHA512:
6
- metadata.gz: 9cfc5a0d2635e86601077c1600f58339252262960663d39e45213ff59aeca09ec47c8a8e392e2ad16a0d4e7b2731b500b33d268c239e44b2567ea2b09cd51ef0
7
- data.tar.gz: 8a14b7b627c493f710c89738c0726f2cc4bca895996a76fcfca4801ff46aaf5047f27a7480aec157b876e807c757f0b3cb9dd3e9bfbe0ffe9d3313ce7dcfe5f8
6
+ metadata.gz: a3f24c9f87df7fbd9e6595c70899c234d439718eca08eeb5b0907a9642014f9f6c52cac651312cdf4abe32e26ab9be8a16c9def5230ddb5b08f953c5fd50c3f3
7
+ data.tar.gz: 927d395de3866fd187f0fbe676a518cbd26eea2f08813e6b746940b9e746794514419a22a94e1972d6068522caa313075159fb0a31df160f62237aebccb53734
@@ -124,30 +124,41 @@ module LocalVault
124
124
  ["OTHER", %w[logout version doctor help]]
125
125
  ].freeze
126
126
 
127
+ # One row per plain command; registered subcommands (sync, team, keys,
128
+ # guard, identity, ...) expand to a row per action, straight from that
129
+ # registry — so `sync push` or a newly added `guard` action is always
130
+ # visible without touching this method.
131
+ def self.help_rows_for(name)
132
+ command = all_commands[name.tr("-", "_")]
133
+ return [] if command.nil? || command.hidden?
134
+
135
+ registry = subcommand_classes[command.name]
136
+ return [[command.usage, command.description]] unless registry
137
+
138
+ registry.all_commands.filter_map do |sub_name, sub|
139
+ next if sub.hidden? || %w[help tree].include?(sub_name) # Thor built-ins, redundant per-namespace
140
+ ["#{command.name} #{sub.usage}", sub.description]
141
+ end
142
+ end
143
+
127
144
  def self.help(shell, subcommand = false)
128
- visible = all_commands.reject { |_, c| c.hidden? }
129
- width = visible.values.map { |c| c.usage.length }.max + 4
145
+ sections = HELP_SECTIONS.map { |title, names| [title, names.dup] }
146
+ known = HELP_SECTIONS.flat_map { |_, names| names.map { |n| n.tr("-", "_") } }
147
+ leftovers = all_commands.reject { |_, c| c.hidden? }.keys - known
148
+ sections.last[1].concat(leftovers.map { |n| n.tr("_", "-") })
149
+
150
+ rendered = sections.map { |title, names| [title, names.flat_map { |n| help_rows_for(n) }] }
151
+ width = rendered.flat_map { |_, rows| rows.map { |usage, _| usage.length } }.max + 4
130
152
 
131
153
  shell.say ""
132
154
  shell.say "LocalVault — encrypted local secrets vault with MCP support for AI agents"
133
155
  shell.say " https://inventlist.com/tools/localvault"
134
156
 
135
- listed = []
136
- sections = HELP_SECTIONS.map { |title, names| [title, names.dup] }
137
- leftovers = visible.keys - HELP_SECTIONS.flat_map { |_, names| names.map { |n| n.tr("-", "_") } }
138
- sections.last[1].concat(leftovers.map { |n| n.tr("_", "-") })
139
-
140
- sections.each do |title, names|
141
- rows = names.filter_map do |name|
142
- command = visible[name.tr("-", "_")]
143
- next unless command
144
- listed << name
145
- " localvault #{command.usage.ljust(width)}#{command.description}"
146
- end
157
+ rendered.each do |title, rows|
147
158
  next if rows.empty?
148
159
  shell.say ""
149
160
  shell.say title
150
- rows.each { |row| shell.say row }
161
+ rows.each { |usage, desc| shell.say " localvault #{usage.ljust(width)}#{desc}" }
151
162
  end
152
163
 
153
164
  shell.say ""
@@ -1,3 +1,3 @@
1
1
  module LocalVault
2
- VERSION = "1.11.2"
2
+ VERSION = "1.11.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localvault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nauman Tariq