-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Documentation for run
is unclear: what are args
?
#35897
Comments
OK, I just (re-)discovered https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs-1 and learned that Julia interpolates |
The |
Yeah, the problem is that E.g. it just took me 10 minutes to figure out (starting from the If nobody beats me to it, I'll eventually submit a PR to improve this particular issue. But really, the same holds for basically every part of the Julia documentation I've looked at so far. Which is why I usually actually do read everything "around" the documentation of a command in the hopes of finding clues how to actually use it; but that doesn't scale too well. It's also not available in the built-in help , i.e. So, I've a feeling that Julia really needs a "improve the documentation push". |
Yes I used it recently and found that really nice, also with the wish that some "reference" docs would be available at the Julia REPL without having to go to the online manual. In case you are not aware, note also that there is now (#34226) some support for "extended help", which is shown at the REPL with |
Do you know how it's implemented? Pipe to |
Yes, invokes Alternatively, one can configure the help system to open the HTML documentation in a browser at the appropriate position; or also the PDF version (I think there's also support for DVI, but that's kinda oldfashioned ;-). |
There is more, though: e.g. one can browse the help in the terminal; search the help and navigate entries (select with up/down arrow the one you like and press return to view it) etc., all via ncurses. That said, if one could set But more important (and also much more work ;-) is to actually have better documentation, including many more refs, be it included in the text "... To suppress an exception being thrown, use ignorestatus(link)" or as a simple list at the end: "see also ignorestatus and FOOBAR.". The only way to get there is a concerted effort I guess, either by lots of people chipping in a bit, or a few people doing major work on that front (possibly hired to do so -- if one has the funding)... I am not going to complain too much here, though, as otherwise you might start listing all the projects I work on that have bad documentation, often far worse what Julia has ;-) but then they are also far less important ;-) |
Thus I don't understand which I should to run: run(`ls`, ["-l"]) or run(`ls`, "-l") or may be run(`ls`, ("-l",)) None work. My last task was to run the some command with the run(`ls $(join(args, " "))`) but it doesn't work for emty Please tell me which code should work. Thank you. |
Try |
It is not worked in the case of empty julia> args = ""
julia> run(`ls $args`)
ls: cannot access '': No such file or directory
ERROR: failed process: Process(`ls ''`, ProcessExited(2)) [2]
Stacktrace:
[1] pipeline_error at ./process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool) at ./process.jl:440
[3] run(::Cmd) at ./process.jl:438
[4] top-level scope at REPL[2]:1
|
It does work if |
Ok, thank you. It's just that this case is not mentioned in the documentation, and I decided to clarify this point. |
I agree the documentation should be clarified (which is why I submitted this issue!) but as discussed in the comments for this issue, your particular usecase is actually discussed in the following section, which I recommend for reading: https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs-1 |
The documentation for
run
says this:But nowhere is explained what
args
is about. One might think that it is meant to be arguments to the command; but that doesn't seem the case:So, what is
args
really for?The text was updated successfully, but these errors were encountered: