Skip to content

Open files from command line#206

Draft
DaleStan wants to merge 3 commits intoShadowTheAge:masterfrom
DaleStan:open-from-command-line
Draft

Open files from command line#206
DaleStan wants to merge 3 commits intoShadowTheAge:masterfrom
DaleStan:open-from-command-line

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.

2 participants