直接从Perforce命令行更改工作区clobber选项(Changing workspace clobber option directly from Perforce command line)

编程入门 行业动态 更新时间:2024-10-27 02:22:18
直接从Perforce命令行更改工作区clobber选项(Changing workspace clobber option directly from Perforce command line)

如何从命令行更改perforce规范? 我想要做的是,我有一个工作区,其clobber选项设置为noclobber(默认值)。 现在我想把它改成clobber。

我知道我们可以直接从p4v做到,但我不想那样做。 我也知道,如果我们在cmd中运行'p4 client'命令,它将在文本编辑器中打开P4CONFIG文件,我们可以将noclobber更改为clobber并保存文件及其完成,但我也不想这样做。

请告诉我在不使用p4v或不编辑P4CONFIG.txt的情况下直接将noclobber更改为clobber的特定命令。

谢谢和问候,Noob perforce管理员

How to change perforce specs from command line? What I want to do is, i have a workspace whose clobber option is set to noclobber(default value). Now i want to change it to clobber.

I know we can do it directly from p4v, but i dont want that. I also know that if we run 'p4 client' command in cmd, it will open P4CONFIG file in text editor, where we can change noclobber to clobber and save the file and its done, but i also dont want that too.

Please tell me the specific command which directly changes the noclobber to clobber without using p4v or without editing P4CONFIG.txt.

Thanks and Regards, Noob perforce admin

最满意答案

使用Perl,Python,Ruby甚至Powershell编写脚本非常容易。 这是Powershell中的单线程:

p4 client -o | %{$_ -replace "noclobber", "clobber"} | p4 client -i

It's pretty easy to script this with Perl, Python, Ruby, or even Powershell. Here's a one-liner in Powershell:

p4 client -o | %{$_ -replace "noclobber", "clobber"} | p4 client -i

更多推荐

本文发布于:2023-08-06 19:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455434.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令行   选项   工作   clobber   Perforce

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!