Skip to content
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

Adding better parameter handling #22

Closed
Kogoro opened this issue Jul 6, 2016 · 8 comments
Closed

Adding better parameter handling #22

Kogoro opened this issue Jul 6, 2016 · 8 comments
Assignees

Comments

@Kogoro
Copy link
Contributor

Kogoro commented Jul 6, 2016

We should improve the parameter handling through a config file or flags in the command line call.
This makes it even easier with optional parameters.

@Kogoro Kogoro added this to the v0.0.2 (September 2016) milestone Jul 6, 2016
@Kogoro Kogoro self-assigned this Jul 6, 2016
@Kogoro
Copy link
Contributor Author

Kogoro commented Sep 15, 2016

.ini files are now supported with the following syntax:

[options]
bibtex-dir=
main-dir=
out-dir-rel=
pdf-dir=
pdf-dir-rel=
tags=tt-tags
clean=true
citationService=true
citation-dir=
out-format=HTML_NEW

The .ini file should lay at the top program folder.

@tthuem
Copy link
Member

tthuem commented Oct 4, 2016

If there is just one .ini file with a fixed location, how can I start several configurations without changing the .ini file(s)?

@Kogoro
Copy link
Contributor Author

Kogoro commented Oct 4, 2016

At the moment it is not possible, but I can add different path support in the next days.

@tthuem
Copy link
Member

tthuem commented Oct 4, 2016

No hurry. I noticed that I can use it with the command-line options for now.

Kogoro pushed a commit that referenced this issue Oct 6, 2016
Kogoro pushed a commit that referenced this issue Oct 6, 2016
@Kogoro
Copy link
Contributor Author

Kogoro commented Oct 6, 2016

Now it is possible to give the path to the .ini file as command line parameter. So you can create different links to the executable and run different configurations. If no parameter is set, it will try to load the options.ini file in the executable's main directory.

@tthuem
Copy link
Member

tthuem commented Oct 19, 2016

I got parsing errors with the following ini file:

bibtex-dir=C:\\Users\\tthuem\\git\\paper-BibTeX\\bibtex\\
main-dir=C:\\Users\\tthuem\\git\\dropbox\\Dropbox\\Literatur\\
out-dir-rel=HTML\\
pdf-dir=..\\Library\\
pdf-dir-rel=Library\\
tags=tt-tags
clean=true
citationService=true
citation-dir=C:\\Users\\tthuem\\git\\paper-BibTeX\\bibtex\\
out-format=HTML_NEW
org.ini4j.InvalidFileFormatException: parse error (at line: 1): bibtex-dir=C:\\Users\\tthuem\\git\\paper-BibTeX\\bibtex\\
        at org.ini4j.spi.AbstractParser.parseError(AbstractParser.java:53)
        at org.ini4j.spi.IniParser.parse(IniParser.java:97)
        at org.ini4j.spi.IniParser.parse(IniParser.java:67)
        at org.ini4j.Ini.load(Ini.java:119)
        at org.ini4j.Ini.load(Ini.java:114)
        at org.ini4j.Ini.load(Ini.java:99)
        at org.ini4j.Ini.<init>(Ini.java:69)
        at de.mibtex.BibtexViewer.main(BibtexViewer.java:72)
Exception in thread "main" java.lang.NullPointerException
        at de.mibtex.BibtexViewer.main(BibtexViewer.java:76)

Can you give an example how the file is supposed to look like or correct the above example?

@Kogoro
Copy link
Contributor Author

Kogoro commented Oct 19, 2016

Should now work. Seems Windows needs a special format other than Linux. Should be fixed now on the dev branch.

My configuration ini looks like this on my Windows machine:

[options]
bibtex-dir=P:\\Github\\MibTeX\\MibTeX\\bibtex\\
main-dir=P:\\Github\\MibTeX\\MibTeX\\bibtex\\
out-dir-rel=..\\HTML\\
pdf-dir=..\\Library\\
pdf-dir-rel=PDF
tags=tt-tags
clean=true
citationService=true
citation-dir=
out-format=HTML_NEW

@tthuem
Copy link
Member

tthuem commented Oct 19, 2016

Took me a while to find out that [options] is required and that you changed the order of two parameters. ;)

Seems to work fine now. Good job! :)

@tthuem tthuem closed this as completed Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants