# Buggy code
def AddArguments(cls, argument_group):
    """Add command line arguments the helper supports to an argument group.

    This function takes an argument parser or an argument group object and adds
    to it all the command line arguments this helper supports.

    Args:
      argument_group: the argparse group (instance of argparse._ArgumentGroup or
                      or argparse.ArgumentParser).
    """
    argument_group.add_argument(
        "--append",
        dest="append",
        action="store_true",
        default=False,
        required=cls._DEFAULT_APPEND,
        help=(
            "Defines whether the intention is to append to an already "
            "existing database or overwrite it. Defaults to overwrite."
        ),
    )
    argument_group.add_argument(
        "--evidence",
        dest="evidence",
        type=str,
        default=cls._DEFAULT_EVIDENCE,
        action="store",
        required=False,
        help="Set the evidence field to a specific value, defaults to empty.",
    )
    argument_group.add_argument(
        "--fields",
        dest="fields",
        type=str,
        action="store",
        nargs="*",
        default=",".join(cls._DEFAULT_FIELDS),
        help="Defines which fields should be indexed in the database.",
    )


# Traceback (AttributeError)
Traceback (most recent call last):
File "/home/travis/build/log2timeline/plaso/tools/psort.py", line 690, in <module>
if not Main():
File "/home/travis/build/log2timeline/plaso/tools/psort.py", line 685, in Main
tool.ProcessStorage()
File "/home/travis/build/log2timeline/plaso/tools/psort.py", line 634, in ProcessStorage
self._ProcessStorage()
File "/home/travis/build/log2timeline/plaso/tools/psort.py", line 218, in _ProcessStorage
self._options, output_module)
File "/home/travis/build/log2timeline/plaso/plaso/cli/helpers/manager.py", line 85, in ParseOptions
helper.ParseOptions(options, config_object)
File "/home/travis/build/log2timeline/plaso/plaso/cli/helpers/dynamic_output.py", line 57, in ParseOptions
field_name.strip() for field_name in fields.split(u',')])
AttributeError: 'list' object has no attribute 'split'

# Fixed code
def AddArguments(cls, argument_group):
    """Add command line arguments the helper supports to an argument group.

    This function takes an argument parser or an argument group object and adds
    to it all the command line arguments this helper supports.

    Args:
      argument_group: the argparse group (instance of argparse._ArgumentGroup or
                      or argparse.ArgumentParser).
    """
    argument_group.add_argument(
        "--append",
        dest="append",
        action="store_true",
        default=False,
        required=cls._DEFAULT_APPEND,
        help=(
            "Defines whether the intention is to append to an already "
            "existing database or overwrite it. Defaults to overwrite."
        ),
    )
    argument_group.add_argument(
        "--evidence",
        dest="evidence",
        type=str,
        default=cls._DEFAULT_EVIDENCE,
        action="store",
        required=False,
        help="Set the evidence field to a specific value, defaults to empty.",
    )
    argument_group.add_argument(
        "--fields",
        dest="fields",
        type=str,
        action="store",
        nargs="*",
        default=cls._DEFAULT_FIELDS,
        help="Defines which fields should be indexed in the database.",
    )