command-line

In CMake how do turn a multi line output of a command into a list?

大兔子大兔子 提交于 2021-02-04 18:09:45
问题 I want to do do something like this execute_process( COMMAND bash -c "git --git-dir ${CMAKE_SOURCE_DIR}/.git ls-files" OUTPUT_VARIABLE TRACKED_FILES) add_custom_target(all_file_project SOURCES ${TRACKED_FILES}) And the command itself seems to work as expected but the generated variable "TRACKED_FILES" contains only one logical entry (one multi line string) rather than a list of files. Can I somehow turn a string containing multiple lines separated by a newline ("\n") into a list in CMake? 回答1

In CMake how do turn a multi line output of a command into a list?

喜你入骨 提交于 2021-02-04 18:09:29
问题 I want to do do something like this execute_process( COMMAND bash -c "git --git-dir ${CMAKE_SOURCE_DIR}/.git ls-files" OUTPUT_VARIABLE TRACKED_FILES) add_custom_target(all_file_project SOURCES ${TRACKED_FILES}) And the command itself seems to work as expected but the generated variable "TRACKED_FILES" contains only one logical entry (one multi line string) rather than a list of files. Can I somehow turn a string containing multiple lines separated by a newline ("\n") into a list in CMake? 回答1

Replace an attribute or key in JSON using jq or sed

我怕爱的太早我们不能终老 提交于 2021-02-04 16:01:07
问题 Have a big json like this "envConfig": { "environmentName": { "versions": [ { "name": "version1", "value": "Dev" }, { "name": "version2", "host": "qa" } ], "userRoles": [ { "name": "Roles", "entry": [ { "name": "employees", "value": "rwx" }, { "name": "customers", "value": "rx" } ] } ] } }, I wanted to change the JSON attribute from "environmentName" to "prod". Below is the output i am expecting "envConfig": { "prod": { "versions": [ ... ], "userRoles": [ ... ] } } Tried with sed command as

C# publishing an .exe and sending params to it using cmd

你离开我真会死。 提交于 2021-02-04 15:43:27
问题 i am pretty sure this is basic but i just dont success to do this i am trying to create a console application that would do ABC by getting few arguments for start i am trying to run something as simple as that static void Main(string[] args) { foreach (var s in args) { Console.WriteLine(s); } Console.ReadLine(); } when i publish it it comes at as a 'clickonce' project like NAME.application instead of NAME.exe also , when i am trying to go execute it with XYZ parms like trying in same folder

C# publishing an .exe and sending params to it using cmd

社会主义新天地 提交于 2021-02-04 15:42:56
问题 i am pretty sure this is basic but i just dont success to do this i am trying to create a console application that would do ABC by getting few arguments for start i am trying to run something as simple as that static void Main(string[] args) { foreach (var s in args) { Console.WriteLine(s); } Console.ReadLine(); } when i publish it it comes at as a 'clickonce' project like NAME.application instead of NAME.exe also , when i am trying to go execute it with XYZ parms like trying in same folder

Is it possible to open VSCode from Windows terminal while SSH'ed into a virtual machine?

孤街浪徒 提交于 2021-01-29 19:56:36
问题 I'm working on some tutorials and trying to do something, but no idea if it can be done. I am using windows terminal in Windows 10. I have an Ubuntu virtual machine running. I'd like to: Open Windows terminal SSH into the Linux Virtual Machine Type in the code . command and have it open a version of VS Code on my Windows PC that is working on the folder in the Ubuntu VM. I tried install code locally and on the command line in the other machine, but it doesn't work. I am sure there are other

Post photo to Twitter using Curl and Windows command line

限于喜欢 提交于 2021-01-29 12:57:37
问题 I am using Curl to post to the Twitter API via the Windows command line. I've already generated the oAuth headers and can post a tweet without a photo using: curl -k -X POST "https://api.twitter.com/1.1/statuses/update.json" -d "status=Test" -H "Authorization: OAuth oauth_consumer_key=\"xxxxxxxxxxxxxxxxxxx\", oauth_nonce=\"xxxxxxxxxxxxxxxxxxxxxxx\", oauth_signature=\"xxxxxxxxxxxxxxxxxxx\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"xxxxxxxxxx\", oauth_token=\"xxxxxxxxxxxxxxxxx\",

Post photo to Twitter using Curl and Windows command line

人盡茶涼 提交于 2021-01-29 12:28:18
问题 I am using Curl to post to the Twitter API via the Windows command line. I've already generated the oAuth headers and can post a tweet without a photo using: curl -k -X POST "https://api.twitter.com/1.1/statuses/update.json" -d "status=Test" -H "Authorization: OAuth oauth_consumer_key=\"xxxxxxxxxxxxxxxxxxx\", oauth_nonce=\"xxxxxxxxxxxxxxxxxxxxxxx\", oauth_signature=\"xxxxxxxxxxxxxxxxxxx\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"xxxxxxxxxx\", oauth_token=\"xxxxxxxxxxxxxxxxx\",

Running two command prompt terminals in native windows, how can I redirect the output of one to the input of the other?

ぃ、小莉子 提交于 2021-01-29 08:04:04
问题 I have one Windows 10 command prompt running and awaiting input, and I wish to automate continuous and live input with a second command prompt. I have gotten the second command prompt to extract the desired variable, and I wish to send it to the other command prompt that is waiting for input. The "awaiting input" command prompt must run in real time because it is connected to Plink (not an SSH session so no use of the -m command here) which is connecting to a microcontroller. So it cannot be

Use ImageMagick to Generate Image from Text?

◇◆丶佛笑我妖孽 提交于 2021-01-29 05:30:37
问题 I'm trying to use ImageMagick to create thumbnail images that are 3840 x 2160. I need the image to have a black background and white text. The text should be centered vertically and horizontally. I want to be able to set a font size, but if the text would extend off the image, automatically decrease the font size so it fits with some amount of padding on the left and right. I will be doing this in bulk with several hundred thousand images. From what I've been able to find, it looks like you