Sha256: 4881c3e967a491d7c92873dd3a13c4480e224a18a70c7fd0cce4ebe3c7f9acf0
Contents?: true
Size: 729 Bytes
Versions: 40
Compression:
Stored size: 729 Bytes
Contents
# coding: utf-8 # frozen_string_literal: true module Stealth module CliBase def define_commands(&blk) class_eval(&blk) if block_given? end def banner(command, nspace = true, subcommand = false) super(command, nspace, namespace != 'stealth:cli') end def handle_argument_error(command, error, args, arity) name = [(namespace == 'stealth:cli' ? nil : namespace), command.name].compact.join(" ") msg = "ERROR: \"#{basename} #{name}\" was called with " msg << "no arguments" if args.empty? msg << "arguments " << args.inspect unless args.empty? msg << "\nUsage: #{banner(command).inspect}" raise Thor::InvocationError, msg end end end
Version data entries
40 entries across 40 versions & 1 rubygems