-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Feature/14361 enable parameters for cli #14500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/14361 enable parameters for cli #14500
Conversation
| @Option(names = "--output", description = "The output .bib file.") | ||
| private Path outputFile; | ||
|
|
||
| @Option( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please implement as a subcommand. We need to keep some hierarchy to keep JabRef and all of its features manageable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks for suggesting .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calixtus
Thanks again for the guidance. I followed your suggestion and tried to update the hierarchy accordingly. Could you please check if it looks correct now and let me know if I should adjust anything before I continue adding the remaining parts?
README.md
Outdated
| @@ -1,4 +1,4 @@ | |||
| # JabRef Bibliography Management [](https://apidia.net/java/JabRef/main) | |||
| # JabRef Bibliography Management [](https://apidia.net/java/JabRef/main) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems unrelated to your PR. Please undo.
| CitationKeyGenerator keyGenerator = new CitationKeyGenerator( | ||
| databaseContext, | ||
| argumentProcessor.cliPreferences.getCitationKeyPatternPreferences()); | ||
| prefs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use abbreviations.
| System.out.println(Localization.lang("Regenerating citation keys according to metadata.")); | ||
| } | ||
|
|
||
| var prefs = argumentProcessor.cliPreferences.getCitationKeyPatternPreferences(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use abbreviations.
|
|
||
| For any inquiries, feel free to [contact ProductMap.ai](https://product-map.ai). | ||
|
|
||
| <!-- markdownlint-disable-file MD060 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to be OK - https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md060---table-column-style
|
|
||
| @Command( | ||
| name = "citationkeys", | ||
| description = "Manage citation key operations.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this is not a good text. Maybe just remove it.
test.bib
Outdated
| @@ -0,0 +1,12 @@ | |||
| @article{dummy, | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use src/main/resources/Chocolate.bib instead of putting a .bib file in the root of the repository.
koppor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments; I don't know What is left todo - the PR is flagged as "draft"
jabkit/src/main/java/org/jabref/toolkit/commands/CitationKeyCommands.java
Show resolved
Hide resolved
jabkit/src/main/java/org/jabref/toolkit/commands/GenerateCitationKeys.java
Outdated
Show resolved
Hide resolved
jabkit/src/main/java/org/jabref/toolkit/commands/GenerateCitationKeys.java
Outdated
Show resolved
Hide resolved
Please work on this. See the screenshot at #14361. |
…egex, delimiter, etc.)
…egex, delimiter, etc.)
|
@calixtus @koppor CitationKeyPatternPreferences supports type-specific patterns , but JabKit’s GlobalCitationKeyPatterns currently applies only a single default pattern and does not support per-entry-type overrides. public class GlobalCitationKeyPatterns extends AbstractCitationKeyPatterns { Because of this mismatch, I’ve kept keyPatterns unchanged for now until your guidance. Thanks! |
Closes #14361
This draft PR starts adding CLI support for citation key customization.
Work in progress.
I will continue adding the remaining options step-by-step.
Currently, I added the first option:
--pattern: override default citation key pattern (e.g., [auth][year]). Not fully optimized yet.
More CLI options from CitationKeyPatternPreferences will be added next.
Steps to test
:jabkit:run --args="citationkeys generate --input=C:\git-repositories\jabref\jablib\src\main\resources\Chocolate.bib --pattern='[auth][year]'"
No GUI settings are modified — this only affects the current CLI run
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)