
from nimp.commands._command import *
from nimp.utilities.build import *

#-------------------------------------------------------------------------------
class VsBuildCommand(Command):

    def __init__(self):
        Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')

    #---------------------------------------------------------------------------
    def configure_arguments(self, env, parser):
        parser.add_argument('solution',
                            help    = 'Solution file',
                            metavar = '<FILE>')

        parser.add_argument('project',
                            help    = 'Project',
                            metavar = '<FILE>',
                            default = 'None')

        parser.add_argument('--target',
                            help    = 'Target',
                            metavar = '<TARGET>',
                            default = 'Build')

        parser.add_argument('-c',
                            '--configuration',
                            help    = 'configuration to build',
                            metavar = '<configuration>',
                            default = 'release')

        parser.add_argument('-p',
                            '--platform',
                            help    = 'platform to build',
                            metavar = '<platform>',
                            default = 'Win64')

        parser.add_argument('--vs-version',
                            help    = 'VS version to use',
                            metavar = '<VERSION>',
                            default = '12')
        return True

    #---------------------------------------------------------------------------
    def run(self, env):
        return vsbuild(env.solution, env.platform, env.configuration, env.project, env.vs_version, env.target)


from nimp.commands._command import *
from nimp.utilities.build import *

#-------------------------------------------------------------------------------
class VsBuildCommand(Command):

    def __init__(self):
        Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')

    #---------------------------------------------------------------------------
    def configure_arguments(self, env, parser):
        parser.add_argument('solution',
                            help    = 'Solution file',
                            metavar = '<FILE>')

        parser.add_argument('project',
                            help    = 'Project',
                            metavar = '<FILE>',
                            default = 'None')

        parser.add_argument('--target',
                            help    = 'Target',
                            metavar = '<TARGET>',
                            default = 'Build')

        parser.add_argument('-c',
                            '--vs-configuration',
                            help    = 'configuration to build',
                            metavar = '<vs-configuration>',
                            default = 'release')

        parser.add_argument('-p',
                            '--vs-platform',
                            help    = 'platform to build',
                            metavar = '<vs-platform>',
                            default = 'Win64')

        parser.add_argument('--vs-version',
                            help    = 'VS version to use',
                            metavar = '<VERSION>',
                            default = '12')
        return True

    #---------------------------------------------------------------------------
    def run(self, env):
        return vsbuild(env.solution, env.vs_platform, env.vs_configuration, env.project, env.vs_version, env.target)

Use separate variable names for Visual Studio config/platform.
Use separate variable names for Visual Studio config/platform.

  
  from nimp.commands._command import *
  from nimp.utilities.build import *
  
  #-------------------------------------------------------------------------------
  class VsBuildCommand(Command):
  
      def __init__(self):
          Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
  
      #---------------------------------------------------------------------------
      def configure_arguments(self, env, parser):
          parser.add_argument('solution',
                              help    = 'Solution file',
                              metavar = '<FILE>')
  
          parser.add_argument('project',
                              help    = 'Project',
                              metavar = '<FILE>',
                              default = 'None')
  
          parser.add_argument('--target',
                              help    = 'Target',
                              metavar = '<TARGET>',
                              default = 'Build')
  
          parser.add_argument('-c',
-                             '--configuration',
+                             '--vs-configuration',
                              help    = 'configuration to build',
-                             metavar = '<configuration>',
+                             metavar = '<vs-configuration>',
                              default = 'release')
  
          parser.add_argument('-p',
-                             '--platform',
+                             '--vs-platform',
                              help    = 'platform to build',
-                             metavar = '<platform>',
+                             metavar = '<vs-platform>',
                              default = 'Win64')
  
          parser.add_argument('--vs-version',
                              help    = 'VS version to use',
                              metavar = '<VERSION>',
                              default = '12')
          return True
  
      #---------------------------------------------------------------------------
      def run(self, env):
-         return vsbuild(env.solution, env.platform, env.configuration, env.project, env.vs_version, env.target)
+         return vsbuild(env.solution, env.vs_platform, env.vs_configuration, env.project, env.vs_version, env.target)
  
Use separate variable names for Visual Studio config/platform.
## Code Before:

from nimp.commands._command import *
from nimp.utilities.build import *

#-------------------------------------------------------------------------------
class VsBuildCommand(Command):

    def __init__(self):
        Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')

    #---------------------------------------------------------------------------
    def configure_arguments(self, env, parser):
        parser.add_argument('solution',
                            help    = 'Solution file',
                            metavar = '<FILE>')

        parser.add_argument('project',
                            help    = 'Project',
                            metavar = '<FILE>',
                            default = 'None')

        parser.add_argument('--target',
                            help    = 'Target',
                            metavar = '<TARGET>',
                            default = 'Build')

        parser.add_argument('-c',
                            '--configuration',
                            help    = 'configuration to build',
                            metavar = '<configuration>',
                            default = 'release')

        parser.add_argument('-p',
                            '--platform',
                            help    = 'platform to build',
                            metavar = '<platform>',
                            default = 'Win64')

        parser.add_argument('--vs-version',
                            help    = 'VS version to use',
                            metavar = '<VERSION>',
                            default = '12')
        return True

    #---------------------------------------------------------------------------
    def run(self, env):
        return vsbuild(env.solution, env.platform, env.configuration, env.project, env.vs_version, env.target)

## Instruction:
Use separate variable names for Visual Studio config/platform.
## Code After:

from nimp.commands._command import *
from nimp.utilities.build import *

#-------------------------------------------------------------------------------
class VsBuildCommand(Command):

    def __init__(self):
        Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')

    #---------------------------------------------------------------------------
    def configure_arguments(self, env, parser):
        parser.add_argument('solution',
                            help    = 'Solution file',
                            metavar = '<FILE>')

        parser.add_argument('project',
                            help    = 'Project',
                            metavar = '<FILE>',
                            default = 'None')

        parser.add_argument('--target',
                            help    = 'Target',
                            metavar = '<TARGET>',
                            default = 'Build')

        parser.add_argument('-c',
                            '--vs-configuration',
                            help    = 'configuration to build',
                            metavar = '<vs-configuration>',
                            default = 'release')

        parser.add_argument('-p',
                            '--vs-platform',
                            help    = 'platform to build',
                            metavar = '<vs-platform>',
                            default = 'Win64')

        parser.add_argument('--vs-version',
                            help    = 'VS version to use',
                            metavar = '<VERSION>',
                            default = '12')
        return True

    #---------------------------------------------------------------------------
    def run(self, env):
        return vsbuild(env.solution, env.vs_platform, env.vs_configuration, env.project, env.vs_version, env.target)
