nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
751 stars 530 forks source link

Help text not working for nipype_cmd #1256

Open blakedewey opened 9 years ago

blakedewey commented 9 years ago

If you don't specify arguments for the interface, you are correctly given the usage and "too few arguments" as excepted. However, if you put -h or --help after the interface, an error is thrown by argparse.

nipype_cmd nipype.interfaces.ants.registration Registration --help
Traceback (most recent call last):
  File ".../anaconda/bin/nipype_cmd", line 8, in <module>
    main(sys.argv)
  File ".../anaconda/lib/python2.7/site-packages/nipype/utils/nipype_cmd.py", line 71, in main
    args = interface_parser.parse_args(args=argv[3:])
  File ".../anaconda/lib/python2.7/argparse.py", line 1701, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File ".../anaconda/lib/python2.7/argparse.py", line 1733, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File ".../anaconda/lib/python2.7/argparse.py", line 1939, in _parse_known_args
    start_index = consume_optional(start_index)
  File ".../anaconda/lib/python2.7/argparse.py", line 1879, in consume_optional
    take_action(action, args, option_string)
  File ".../anaconda/lib/python2.7/argparse.py", line 1807, in take_action
    action(self, namespace, argument_values, option_string)
  File ".../anaconda/lib/python2.7/argparse.py", line 996, in __call__
    parser.print_help()
  File ".../anaconda/lib/python2.7/argparse.py", line 2340, in print_help
    self._print_message(self.format_help(), file)
  File ".../anaconda/lib/python2.7/argparse.py", line 2314, in format_help
    return formatter.format_help()
  File ".../anaconda/lib/python2.7/argparse.py", line 281, in format_help
    help = self._root_section.format_help()
  File ".../anaconda/lib/python2.7/argparse.py", line 211, in format_help
    func(*args)
  File ".../anaconda/lib/python2.7/argparse.py", line 211, in format_help
    func(*args)
  File ".../anaconda/lib/python2.7/argparse.py", line 517, in _format_action
    help_text = self._expand_help(action)
  File ".../anaconda/lib/python2.7/argparse.py", line 603, in _expand_help
    return self._get_help_string(action) % params
TypeError: %d format: a number is required, not dict
djarecka commented 6 years ago

nipype_cmd is now nipypecli run