Closed helge000 closed 3 years ago
I don't think there's a reasonable way to do what you're describing. For starters, what should the arguments to the "inner" commands be? In some cases you might want the arguments that were passed to the outer command, but not in others.
In this situation I would really recommend decoupling your application code from the commander DSL — structure your code within its own class or module and call those methods from your commander commands.
class MyApp
# call these from your commander commands like `MyApp.new.import_everything`
def import_everything
end
def export_everything
end
end
I couldn't feature out which method to call when I need to call a defind command from within another command's block. Example: