how to invoke clangd to format a file - clang

I have a workable version of clangd in my bin, but there is no clang-format. I want to format a file from command line, how to do this?
In clangd doc, it says
clangd embeds clang-format
A standalone clang-format can directly format a file from command line. I don't know whether clangd can do the same.

Related

How to run QAC tool from command line?

I have a C project and I would like to run QAC tool v7.0 from command line. I tried the following option,
C:\qac.exe -via <project_name.prj>
However, when I run the above command. I get an error saying the "VersionTag" is not found. The "VersionTag" string is the first line in the .prj file. I am not sure this is the right way to run this tool. Any help appreciated.
The qac -help is not giving valuable information either. The tool version is pretty old and the company 'Programming Research' behind this tool also has been renamed? to Perforce. They do not have any information about command line invocation either from the existing documentation or webpage.
The QAC utility is the "engine" part of the QAC package, corresponding to a compiler.
It won't be happy being run on command line without a number of environment variables:
QACBIN must point to the bin directory of the QAC package installation;
QACHELPFILES must point to the location of message help files;
QACOUTPUT points to the location where output files will be generated (binary .err file for each source file and textual .met file containing semantic and metric information.
The -via parameter to the command line should point at a text file containing other parameters used by the utility.
The .prj file is a package-level file defining the location of C source files being analysed plus their configuration settings files, among other things. It definitely should not be passed directly as a parameter to the QAC utility.
This should get you started, and other questions need to be more specific.

UTF-8 char in path used by groovy in Jenkins

I need to copy a file, using a groovy script in Jenkins (pipeline). This file has the character ü in it, which results in the file not being found. I've tried renaming the file to a standard u, and it works. However, this is not an option, I need the ü. Any suggestions how to solve this?
Edit: I'm using Windows 7, using the batch command xcopy.
Edit2: The command being issued is:
bat "xcopy \"${files[i].path}\" \"${path}\""
Where files[i].path is the file name containing the ü character, and path is the complete path where to put the file.

Clang-Format: How to specify a custom format options file?

I'm trying to configure a custom style options file for clang-format v6.0.0 running on Windows 10 Pro 64-bit. I started out by generating an options file based upon the llvm style using the following command line, which worked fine:
clang-format -style=llvm -dump-config > .clang-format
The documentation for clang-format states the following:
"When the desired code formatting style is different from the available options, the style can be customized using the -style="{key: value, ...}" option or by putting your style configuration in the .clang-format or _clang-format file in your project’s directory and using clang-format -style=file."
So just as a test I used the unchanged .clang-format file I generated above and used the following command line:
clang-format -style=.clang-format Test.c
The result was a message that said
"Invalid value for -style"
I then changed the name of .clang-format to _clang-format and tried it again but the result was the same. So, my question is, "How do I specify a specific style options file?"
As you correctly discovered command is expecting the literal -style=file. For example clang-format.exe -i -style=file The -i option is to execute the changes in place. The -style=file is telling the program to look in the current directory for the configuration file named .clang-format or _clang-format Configuration options. If the config file is still not found the program will move up a directory and continue searching and so on. More command line documentation can be found here.

How to batch open txt files and save each with Sublime in linux command line?

How to command Sublime from linux command line?
I know how to open file in background but not how to call save function?
I have some character issues which Sublime seems to fix and therefore I'd like to run a batch of files through Sublime.
So the available commands are listed on the reference section of docs:
https://docs.sublimetext.io/reference/commands.html

Sublime Text 3 LaTeXTools plugin won't compile on Debian

When doing Ctrl+B on SublimeText3, the following error is output:
[Compiling first.tex]
TraditionalBuilder: Invoking latexmk...
COULD NOT COMPILE!
Attempted command:latexmk -cd -e $pdflatex='pdflatex -interaction=nonstopmode -synctex=1 %S %O' -f -pdf first.tex
Build engine: Traditional Builder
Running the exact same command compiles a pdf file just fine.
This answer does not solve the problem, as I've
Removed spaces around "="
Done a "Reconfigure LaTeXTools and migrate settings".
Made sure pdflatex is installed.
Made sure the path for texpath is correct.
If your command runs on terminal then most likely there is an issue either with the path or with the command itself (in the file). There has been some update to the README file by the developer:
some distros do not want a space before and after the = in $pdflatex = %E. But some do want the space there (sigh!)
sometimes latexmk is not on the PATH, or the path is not correctly picked up by ST. In this case, instead of "latexmk", use "/usr/bin/latexmk" or wherever latexmk is in your system.
some distros require quoting the $pdflatex assignment, as in "$pdflatex = \"'%E -interaction=nonstopmode -synctex=1 %S %O'\""
So it might take a while but you'll find it eventually in the settings or the traditionalbuilder.py file.
Also when I tried putting /usr/bin/latexmk, latex did not produce the correct pdf (I checked it with few changes and it just opened the old pdf) but in your case it might work.
Also, at least in Arch Linux I can't run sublime with sublime-text but instead with subl so I changed that too in the settings (I don't know if it actually matters) and I needed to change the permissions for the files because user-run sublime could not access my settings files!

Resources