def buildCliString(self): """ Collect all of the required information from the config screen and build a CLI string which can be used to invoke the client program """ config = self.navbar.getActiveConfig() group = self.buildSpec['widgets'][self.navbar.getSelectedGroup()] positional = config.getPositionalArgs() optional = config.getOptionalArgs() print( cli.buildCliString(self.buildSpec['target'], group['command'], positional, optional)) return cli.buildCliString(self.buildSpec['target'], group['command'], positional, optional)
def buildCliString(self): """ Collect all of the required information from the config screen and build a CLI string which can be used to invoke the client program """ config = self.navbar.getActiveConfig() group = self.buildSpec['widgets'][self.navbar.getSelectedGroup()] positional = config.getPositionalArgs() optional = config.getOptionalArgs() print(cli.buildCliString( self.buildSpec['target'], group['command'], positional, optional )) return cli.buildCliString( self.buildSpec['target'], group['command'], positional, optional )
def test_cli(self): print(cli.buildCliString('target', 'cmd', ['pos1', 'pos2'], ['-a 1', '-b 2'])) positionals = [ {'clitype': 'positional', 'cmd': 'pos1', 'required': True}, {'clitype': 'positional', 'cmd': 'pos2', 'required': True} ] optionals = [ {'clitype': 'optional', 'cmd': '-a 1', 'required': False}, {'clitype': 'optional', 'cmd': '-b 2', 'required': False}, ] # print(cli.formValidationCmd('target', 'cmd', positionals, optionals))