Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open files from command line #206

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DaleStan
Copy link
Contributor

@DaleStan DaleStan commented Feb 7, 2023

I kept expecting to be able to double-click YAFC files to get them to open, so I made that happen.

If we don't know which Factorio installation and/or mod folder to use, automatically select the file, but let the user select the data folders.
@veger
Copy link
Contributor

veger commented Feb 17, 2023

It might be better to add some flag like --load, so it would be possible to extend the command line actions in a later stage if needed. On the other hand, those flags could be added (breaking change) when/if needed in the future... 😄

@DaleStan
Copy link
Contributor Author

I don't like that because it makes it harder for Windows users to set up the file associations.
Most Unixy executables work the same way; neither vim nor emacs require --load before the filename.

That said, I should allow and ignore --, so a defensive script can do yafc -- $1 or yafc -- %1 and not worry about people who want to open a file named --export-page=Default.yafc. What appears to be the best available getopt-compatible library doesn't support this yet, so I'll make a PR there and come back to this.

@DaleStan DaleStan marked this pull request as draft February 18, 2023 03:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants