Bug found

12 views
Skip to first unread message

Dieter Van Eessen

unread,
Aug 5, 2018, 3:45:54 PM8/5/18
to xonsh
Hello,

bumped on problem when using the command 'xonsh --rc <file1> <file2>'.

The behavior i expect is to use <file1> as RC file and <file2> as file. Instead I get both <file1> and <file2> to be used as RC files.
The argument parser accepts multiple files as  RC file, don't know if this is the intended behavior or not?

For the moment using a dirty solution: modified xonsh.main.premain
line 286 'elif args.rc:' and replaced it with 'if args.rc:' and now using 'xonsh --rc <file1> --no-rc <file2>' as a temp fix

Are you allowing multiple RC's on purpose or is this minor bug in the argument parser?

kind regards,
Dieter 

Anthony Scopatz

unread,
Aug 6, 2018, 5:34:20 PM8/6/18
to Dieter Van Eessen, xonsh
Hi Dieter, 

Thanks for bringing this up!  This is, in fact, the intended behavior. We do support multiple RC files, and by default we have:

scopatz@artemis ~/xonsh master $ $XONSHRC
EnvPath(
['/etc/xonshrc',
 '/home/scopatz/.config/xonsh/rc.xsh',
 '/home/scopatz/.xonshrc']
)

However, I believe that if you want to run a file with an rc, you can run:

xonsh <file-to-run> --rc <rc-file>

I hope this helps!

Be Well
Anthony

--
You received this message because you are subscribed to the Google Groups "xonsh" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xonsh+un...@googlegroups.com.
To post to this group, send email to xo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xonsh/5c852c5b-3c7a-48b8-973b-a963900f4163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Asst. Prof. Anthony Scopatz
Nuclear Engineering Program
Mechanical Engineering Dept.
University of South Carolina
sco...@cec.sc.edu
Cell: (512) 827-8239
Book a meeting with me at https://scopatz.youcanbook.me/
Open up an issue: https://github.com/scopatz/me/issues
Check my calendar

Dieter Van Eessen

unread,
Aug 7, 2018, 2:33:21 AM8/7/18
to Anthony Scopatz, xonsh
thanks for the reply.
It's a bit counter-intuitive :) mostly shell commandline are formatted <command> <options> <file>

Have you considered the format 'xonsh --rc <rcfile1> --rc <rcfile2> <file>' (issue has been solved before:
Just an idea, don't know how well pythons' argparse supports this...

kind regards,
Dieter



To unsubscribe from this group and stop receiving emails from it, send an email to xonsh+unsubscribe@googlegroups.com.

To post to this group, send email to xo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xonsh/5c852c5b-3c7a-48b8-973b-a963900f4163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages