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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants