ess / belafonte

Jump in the command line with the master of CLIpso (yet another CLI command suite library, which is basically usable right now, but needs much better documentation)
MIT License
5 stars 1 forks source link

Mounting app never handles a command line #6

Open ess opened 8 years ago

ess commented 8 years ago

As it stands right now, the handle method for OuterApp in the following example never has a chance to execute:

require 'belafonte'

class InnerApp < Belafonte::App
  title "inner"

  def handle
    stdout.puts "This is the inner app"
  end
end

class OuterApp < Belafonte::App
  title "outer"

  mount InnerApp

  def handle
    stdout.puts "This is the outer app"
  end
end

exit OuterApp.new(ARGV).execute!
ess commented 8 years ago

I'm beginning to wonder if the above scenario is realistic. Should OuterApp#handle ever get called, or is it reasonable to expect that the top-level of a command suite is just a wrapper?