Skip to content

Conversation

@Andriamanitra
Copy link
Contributor

@Andriamanitra Andriamanitra commented Jul 8, 2024

Changes behavior of -c flag such that:

  • janet -c foo.janet writes to foo.jimage
  • janet -c foo writes to foo.jimage

Previously these would cause a confusing error due to out of bounds access to the args array (see #1451).

The default is only used if there are no more arguments after the input file – I didn't add any special handling for edge cases like janet -c foo.janet -h (which uses '-h' as the output file).

closes #1451

@sogaiu
Copy link
Contributor

sogaiu commented Jul 8, 2024

Gave the changes a try.

Both invocations seemed to work 👍

When a file named foo did not exist I got an error like:

error: could not find file foo in dofile [boot.janet] on line 2966, column 5 in c-switch [boot.janet] (tail call) on line 4477, column 19 in cli-main [boot.janet] on line 4520, column 13 

which seemed helpful.

@bakpakin bakpakin merged commit 31f0ff0 into janet-lang:master Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants