Skip to content

feat: allow -f option to accept a file path - #11

Open
Cycatz wants to merge 1 commit into
BenBrock:masterfrom
Cycatz:master
Open

feat: allow -f option to accept a file path#11
Cycatz wants to merge 1 commit into
BenBrock:masterfrom
Cycatz:master

Conversation

@Cycatz

@Cycatz Cycatz commented May 12, 2022

Copy link
Copy Markdown

I've been using reple for a while and it's been great! But I found I can't specify my local config file with -f option.
Although I've seen it was mentioned in #4, it seemed not work for me.

$ reple -f /tmp/cxx.json
Traceback (most recent call last):
  File "/home/cycatz/workspace/reple/reple/reple", line 8, in <module>
    reple.run_reple(sys.argv[1:])
  File "/home/cycatz/workspace/reple/reple/reple.py", line 283, in run_reple
    config = json.load(open(fname, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: '/home/cycatz/workspace/reple/reple/configs//tmp/cxx.json'

So I slightly modified the get_config_fname function, here are the steps:

  1. try to use the argument as the file path if the file exists;
  2. otherwise, fallback to use it as a config name to find under reple configs directory.

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.

1 participant