moss

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 923bc5cad0b3c0bd51fb3a57999bfd6d8b94e15a
parent 4a864673cf8854c16123f4dbfe30438383164d37
Author: Daniel Barlow <dan@telent.net>
Date:   Thu, 12 Aug 2021 00:03:20 +0100

delete "help" from todo list, it is done

Diffstat:
MREADME.md | 1-
Mmoss.rb | 4+++-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md @@ -186,5 +186,4 @@ security requirements, look elsewhere. * copy to clipboard * check before overwriting secrets that exist already * support re-encrypting a subtree when recipients change -* --help option * warn or fail if iffy store permissions? diff --git a/moss.rb b/moss.rb @@ -179,9 +179,11 @@ class CLI end def dispatch(name, *parameters) - command = @@commands[name.to_sym] + command = @@commands.fetch(name.to_sym) instance = new instance.public_send(command[:name], *parameters) + rescue KeyError => e + raise "Command not recognized, try \"moss help\"" rescue ArgumentError => e meth = instance.method(command[:name]) params = meth.parameters.map {|p| "<#{p[1]}>" }.join(" ")