!config
# Arara, the cool TeX automation tool
# Copyright (c) 2023, Island of TeX
# All rights reserved.
#
# This rule is part of arara.
identifier: authorindex
name: AuthorIndex
authors:
- Island of TeX
commands:
- name: The AuthorIndex script
  command: >
    @{
        return getCommand('authorindex', draft, index, keep, print,
                          recurse, options, getBasename(reference.fileName));
    }
arguments:
- identifier: draft
  flag: >
    @{
        return isTrue(parameters.draft, '-d');
    }
- identifier: index
  flag: >
    @{
        return isTrue(parameters.index, '-i');
    }
- identifier: keep
  flag: >
    @{
        return isTrue(parameters.keep, '-k');
    }
- identifier: print
  flag: >
    @{
        return isTrue(parameters.print, '-p');
    }
- identifier: recurse
  flag: >
    @{
        return isFalse(parameters.recurse, '-r');
    }
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.');
        }
    }
