简体   繁体   English

在JetBrains IDE(例如CLion,IntelliJ)中,外部工具无法使用通配模式

[英]In JetBrains IDEs (e.g. CLion, IntelliJ), external tools cannot use globbing patterns

I added an external tool to CLion with the following details: 我向CLion添加了一个外部工具,其详细信息如下:

Program: zip
Parameters: asm.zip *.cc *.h
Working directory: $ProjectFileDir$

When I run this external tool as part of my build command, it says: 当我在构建命令中运行此外部工具时,它说:

zip asm.zip *.cc *.h
    zip warning: name not matched: *.cc
    zip warning: name not matched: *.h

zip error: Nothing to do! (asm.zip)

Process finished with exit code 12

But when I replace the details with: 但是当我将细节替换为:

Program: ls
Parameters:
Working directory: $ProjectFileDir$

Then the output is the list of files in the project folder (which includes .cc and .h files) and the build completes successfully. 然后,输出为项目文件夹中的文件列表(包括.cc和.h文件),并且构建成功完成。 What am I doing wrong? 我究竟做错了什么?

Clion invokes the command you run directly, without expanding globs ( * character). Clion会调用您直接运行的命令,而不会扩展glob( *字符)。

Modify the settings to, eg.: 将设置修改为例如:

Program: sh
Parameters: -c "zip asm.zip *.cc *.h"

This way, the sh shell will correctly expand the arguments. 这样, sh shell将正确扩展参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Vagrantfile中使用动态值,例如Shell变量 - How to use Dynamic values in Vagrantfile e.g. Shell variables awk 读取浮点精度:无法读取小浮点数,例如 4e-320 - awk read float precision: cannot read small floats, e.g. 4e-320 在“传统” awk(例如nawk)而不是区间表达式中使用什么? - What to use in “traditional” awks (e.g. nawk) instead of interval expressions? 如何在终端中将特定的python版本设置为默认版本,但要保留使用另一个(例如conda)作为软件包的可能性 - How to set a particular python version as default in terminal, but to keep the possibility to use another (e.g. conda) for a package 如何将一个列表(例如2和3)上的数字与另一个列表中的近似值(例如5)进行匹配? - How to match numbers on one list (e.g. 2 and 3) with the approximate sum on another list (e.g. 5)? Shell globbing 排除目录模式 - Shell globbing exclude directory patterns 在bash中包含和排除globbing模式 - Including and excluding globbing patterns in bash IntelliJ 在外部工具中采购 .sh 不起作用 - IntelliJ sourcing .sh in external tools is not working 创建制表符完成脚本。在一种情况下,我想使用完成另一个命令(例如git),是否可能? - Creating a tab completion script. In one case I want to use the completion for another command (e.g. git), is it possible? 拆分字符串(例如使用bash)但跳过部分字符串 - split string (e.g. with bash) but skip part of it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM