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

Refactor argument parsing #21

Closed
atticus-sullivan opened this issue Dec 17, 2024 · 2 comments
Closed

Refactor argument parsing #21

atticus-sullivan opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
refactor Some code needs to be refactor
Milestone

Comments

@atticus-sullivan
Copy link
Owner

Like noted in #20 the current argument parsing is not as clean as I like it to be.

C.f.

if opt.param then
if param then
-- --option=param
else
if opt.default ~= nil then
-- no param with space if option specifies a
-- default in order to avoid accidentally
-- consuming the next argument
param = opt.default
else
-- --option param

We should refactor/rewrite this.

Note: It's important that --option0 --option1 or also --option0 file.tex is still possible even if --option0 has a default value. If that's not possible we should consider disabling passing parameters this way (only via = possible then) or maybe even move the whole configuration to the config file (#16) eventually (but I'd prefer to still have commandline options).

@atticus-sullivan atticus-sullivan self-assigned this Dec 17, 2024
@atticus-sullivan atticus-sullivan added the refactor Some code needs to be refactor label Dec 17, 2024
@atticus-sullivan
Copy link
Owner Author

atticus-sullivan commented Dec 18, 2024

Also remember to

  • put more comments in the code
  • think about splitting up large functions into smaller more manageable ones -> we can write more tests then

@atticus-sullivan
Copy link
Owner Author

Already done in #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Some code needs to be refactor
Projects
None yet
Development

No branches or pull requests

1 participant