| skipped 22 lines |
23 | 23 | | import sys |
24 | 24 | | import traceback |
25 | 25 | | import requests |
| 26 | + | import shlex |
26 | 27 | | from .util.helpers import rand_uagent |
27 | 28 | | from textwrap import wrap |
28 | 29 | | |
| skipped 615 lines |
644 | 645 | | if not params: |
645 | 646 | | self.help_report() |
646 | 647 | | return |
647 | | - | arg = params.lower().split(' ') |
| 648 | + | if self._mode == 'execute': |
| 649 | + | arg = sys.argv[3:] |
| 650 | + | else: |
| 651 | + | arg = shlex.split(params) |
648 | 652 | | gather_file = os.path.join(self.workspace, 'gather.dat') |
649 | 653 | | if not os.path.exists(gather_file): |
650 | 654 | | self.alert('No data found.') |
| skipped 6 lines |
657 | 661 | | self.error('Gather data is incorrect. Gather is missed!') |
658 | 662 | | return |
659 | 663 | | |
660 | | - | if arg[0] == 'saved': |
| 664 | + | if arg[0].lower() == 'saved': |
661 | 665 | | if gather_data: |
662 | 666 | | for mod in gather_data: |
663 | 667 | | self.alert(mod) |
| skipped 3 lines |
667 | 671 | | self.output('No result found.') |
668 | 672 | | print('') |
669 | 673 | | return |
670 | | - | |
671 | 674 | | if len(arg) < 3 or len(arg) > 4: |
672 | 675 | | self.error("Module name not found") |
673 | 676 | | self.help_report() |
674 | 677 | | return |
675 | | - | _format = arg[0] |
| 678 | + | _format = arg[0].lower() |
676 | 679 | | if _format not in ('json', 'txt', 'xml', 'csv'): |
677 | 680 | | self.error(f"Format '{_format}' doesn't found.") |
678 | 681 | | return |
| skipped 147 lines |