Sha256: 74896315feadae77fd85a2564cd0e7dd2ef72fce518ff684babdab0bc22b07b3

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

# -*- coding: UTF-8 -*-

require 'mj/tools/subprocess'
require 'build-tool/commands'

module BuildTool; module Commands; module Modules

    #
    # BuildCommand
    #
    class MyShell < Standard

        include MJ::Tools::SubProcess

        name        "shell"
        description "Open a shell with the environment for the given module."

        def initialize_options
            options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULE"
            options.separator( "" )
            options.separator( "Options" )
            super
        end

        def do_execute( args )
            # Check the number of commandline args
            if args.length != 1
                return usage( "Wrong number of arguments" )
            end

            # Translate argument into modules
            mod = complete_modules( args[0] )
            if mod.length != 1
                return usage( "This command only works on one module" )
            end

            # Get our one and only module
            mod[0].environment.shell
        end

    end # class Shell

end; end; end # module BuildTool::Commands::Modules



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
build-tool-0.6.1 lib/build-tool/commands/modules/shell.rb
build-tool-0.6.0 lib/build-tool/commands/modules/shell.rb
build-tool-0.6.0.rc2 lib/build-tool/commands/modules/shell.rb
build-tool-0.6.0.rc1 lib/build-tool/commands/modules/shell.rb