Skip to content

Enable parameters for CLI: generate-citation-keys #14361

@koppor

Description

@koppor

Currently, the generate-citation-keys command from JabKit doesn't allow for customization

Usage: jabkit generate-citation-keys [-dhp] --input=<inputFile>
                                     [--output=<outputFile>]
Generate citation keys for entries in a .bib file.
  -d, --debug               Enable debug output
  -h, --help                display this help message
      --input=<inputFile>   Input BibTeX file
      --output=<outputFile> The output .bib file.
  -p, --porcelain           Enable script-friendly output

However, JabRef allows for much customization: https://docs.jabref.org/setup/citationkeypatterns

This should also be offered in the CLI.

You can check the GUI for the options

Image

Task:

  • Offer each element of CitationKeyPatternPreferences as parameter in the CLI for org.jabref.toolkit.commands.GenerateCitationKeys
  • Thereby, construct new org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences based on CLI options. If no option is provided for a parameter, use the values from user-configured JabRefCliPreferences (argumentProcessor.cliPreferences).

Hints:

  • You can use org.jabref.toolkit.converter.CaseInsensitiveEnumConverter to convert an enum (see usage of the class for how to do)
  • Key patterns is a map, which can be implemented in PicoCLI using https://picocli.info/#_maps

Metadata

Metadata

Assignees

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions