Opening file from command line Follow
Is there a way to open a file from the command line into a _currently_ running CLion session? I.e. do the equivalent of 'Navigate'/'Files' from a terminal window.
Please sign in to leave a comment.
If you perform the command described at https://www.jetbrains.com/idea/help/working-with-intellij-idea-features-from-command-line.html in “Opening file in the editor” (replace IntellijJ IDEA with CLion, of course) the file is opened in the existing window if the desired project is already opened.
When I try the recipe (with CLion 1.2) I get
and in the running CLion there is an error message complaining that /Applications/CLion.app/Contents/bin/./inspect does not exist.
Could you please specify which command did you use?
where /opt/build/root_builds/rootcling.debug is the location of the (already opened) project and /opt/build/root_builds/rootcling.debug/src/core/base/src/TROOT.cxx the location of the file.
Sorry for the delay!
To open file for editing please type the following in the command line:
An example for OS X:
/Applications/CLion.app/Contents/MacOS/clion ~/CLionProjects/untitled45 --line 1 ~/CLionProjects/untitled45/sample.txt
Does that help?
This is indeed working. Thanks,
I see the --line option, where can I find the complete list of supported command line options?
Is there any way to automatically use the current project if only one instance of clion is open?