!config
# Arara, the cool TeX automation tool
# Copyright (c) 2020, Island of TeX 
# All rights reserved.
#
# This rule is part of arara.
identifier: nomencl
name: Nomencl
authors:
- Island of TeX
commands:
- name: The Nomenclature software
  command: >
    @{
        nlo = getBasename(reference).concat('.nlo');
        nls = getBasename(reference).concat('.nls');
        return getCommand('makeindex', options, nlo, style, '-o', nls);
    }
arguments:
- identifier: style
  flag: >
    @{
        [ '-s', parameters.style ]
    }
  default: >
    @{
        [ '-s', 'nomencl.ist' ]
    }
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.');
        }
    }
