You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
485 B

  1. from itertools import chain
  2. from copy import deepcopy
  3. from gooey.util.functional import compact
  4. def buildCliString(target, cmd, positional, optional):
  5. positionals = deepcopy(positional)
  6. if positionals:
  7. positionals.insert(0, "--")
  8. cmd_string = ' '.join(compact(chain(optional, positionals)))
  9. if cmd != '::gooey/default':
  10. cmd_string = u'{} {}'.format(cmd, cmd_string)
  11. return u'{} --ignore-gooey {}'.format(target, cmd_string)