!config
# Arara, the cool TeX automation tool
# Copyright (c) 2023, 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.fileName).concat('.nlo');
        nls = getBasename(reference.fileName).concat('.nls');
        return getCommand('makeindex', options, nlo, style, '-o', nls);
    }
arguments:
- identifier: style
  flag: >
    @{
        [ '-s', isEmpty(parameters.style, 'nomencl.ist', parameters.style) ]
    }
  default: ''
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.');
        }
    }