Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when passing stealth generate without arguments #171

Open
luizcarvalho opened this issue Mar 28, 2019 · 1 comment
Open

Error when passing stealth generate without arguments #171

luizcarvalho opened this issue Mar 28, 2019 · 1 comment
Milestone

Comments

@luizcarvalho
Copy link
Contributor

luizcarvalho commented Mar 28, 2019

Hello friends,

I tried use stealth generate expecting receive a message to help me use command, but I received this error.

Traceback (most recent call last):
	10: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
	 9: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
	 8: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/bin/stealth:23:in `<main>'
	 7: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/bin/stealth:23:in `load'
	 6: from /home/desenvolvimento/dev/51/stealth-example-1_1_6/vendor/gems/stealth/bin/stealth:5:in `<top (required)>'
	 5: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	 4: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	 3: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	 2: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/command.rb:20:in `run'
	 1: from /home/desenvolvimento/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/command.rb:34:in `rescue in run'
/home/desenvolvimento/dev/51/stealth-example-1_1_6/vendor/gems/stealth/lib/stealth/cli_base.rb:19:in `handle_argument_error': can't modify frozen String (FrozenError)

I'm using ruby 2.5.3 (tried 2.5.1 too) and Stealth 1.1.6

I made a little modification in cli_base.rb file to solve this, but I do not know if it is the best solution.

    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 = "#{msg}no arguments"               if     args.empty?
      msg = "#{msg}arguments #{args.inspect}"  unless args.empty?
      msg = "#{msg}\nUsage: #{banner(command).inspect}"

      raise Thor::InvocationError, msg
    end

@luizcarvalho
Copy link
Contributor Author

When I try use another wrong command stealth generate product, the error message is, maybe, doesn't help much.

ERROR: "stealth generate" was called with arguments ["product"]
Usage: "stealth generate"

I can help with this.

@mgomes mgomes added this to the 2.0 milestone Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants