Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
db631721
P
Pdm
项目概览
后端镜像
/
Pdm
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pdm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
db631721
编写于
4月 03, 2021
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get scripts from bin folder as well
上级
d245736b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
16 deletion
+43
-16
pdm/cli/completions/pdm.bash
pdm/cli/completions/pdm.bash
+1
-1
pdm/cli/completions/pdm.fish
pdm/cli/completions/pdm.fish
+1
-0
pdm/cli/completions/pdm.ps1
pdm/cli/completions/pdm.ps1
+16
-13
pdm/cli/completions/pdm.zsh
pdm/cli/completions/pdm.zsh
+25
-2
未找到文件。
pdm/cli/completions/pdm.bash
浏览文件 @
db631721
...
...
@@ -57,7 +57,7 @@ opts="--dev --format --global --help --project --section --verbose"
;;
(
info
)
opts
=
"--env --global --help --project --python --verbose --where"
opts
=
"--env --global --help --project --python --verbose --where
--packages
"
;;
(
init
)
...
...
pdm/cli/completions/pdm.fish
浏览文件 @
db631721
...
...
@@ -109,6 +109,7 @@ complete -c pdm -A -n '__fish_seen_subcommand_from info' -l project -d 'Specify
complete -c pdm -A -n '__fish_seen_subcommand_from info' -l python -d 'Show the interpreter path'
complete -c pdm -A -n '__fish_seen_subcommand_from info' -l verbose -d '-v for detailed output and -vv for more detailed'
complete -c pdm -A -n '__fish_seen_subcommand_from info' -l where -d 'Show the project root path'
complete -c pdm -A -n '__fish_seen_subcommand_from info' -l packages -d 'Show the packages root'
# init
complete -c pdm -A -n '__fish_seen_subcommand_from init' -l global -d 'Use the global project, supply the project root with `-p` option'
...
...
pdm/cli/completions/pdm.ps1
浏览文件 @
db631721
...
...
@@ -157,22 +157,25 @@ function getConfigKeys() {
}
function
getScripts
()
{
if
(
-not
(
Test-Path
-Path
"pyproject.toml"
))
{
return
@()
}
[
string
[]]
$scripts
=
@()
[
bool
]
$inScripts
=
$false
foreach
(
$line
in
(
Get-Content
"pyproject.toml"
))
{
if
(
$line
-match
' *\[tool\.pdm\.scripts\]'
)
{
$inScripts
=
$true
}
elseif
(
$inScripts
-and
(
$line
-match
'(\S+) *= *'
))
{
$scripts
+=
$Matches
[
1
]
}
elseif
(
$line
-like
'`[*`]'
)
{
$inScripts
=
$false
$packagesDir
=
(
&
$PDM_PYTHON
-m
pdm
info
--packages
)
if
(
Test-Path
-Path
"pyproject.toml"
)
{
[
bool
]
$inScripts
=
$false
foreach
(
$line
in
(
Get-Content
"pyproject.toml"
))
{
if
(
$line
-match
' *\[tool\.pdm\.scripts\]'
)
{
$inScripts
=
$true
}
elseif
(
$inScripts
-and
(
$line
-match
'(\S+) *= *'
))
{
$scripts
+=
$Matches
[
1
]
}
elseif
(
$line
-like
'`[*`]'
)
{
$inScripts
=
$false
}
}
}
if
(
$packagesDir
-ne
"None"
)
{
$scripts
+=
(
Get-ChildItem
"
$packagesDir
\Scripts"
|
ForEach-Object
{
$_
.
Basename
})
}
return
$scripts
}
...
...
pdm/cli/completions/pdm.zsh
浏览文件 @
db631721
...
...
@@ -144,6 +144,7 @@ _pdm() {
'--python[Show the interpreter path]'
'--where[Show the project root path]'
'--env[Show PEP 508 environment markers]'
'--packages[Show the packages root]'
)
;;
init|lock
)
...
...
@@ -186,7 +187,7 @@ _pdm() {
'*:arguments: _normal '
&&
return
0
if
[[
$state
==
command
]]
;
then
_command_names
-e
local
local_commands
=(
__pypackages__/3.9/bin/
*
(
N:t
))
local
local_commands
=(
$(
_pdm_scripts
)
)
_describe
"local command"
local_commands
return
0
fi
...
...
@@ -249,7 +250,7 @@ _pdm_sections() {
_message
"not a pdm project"
return
1
fi
local
l
match
sections
=()
in_sections
=
0
local
l
sections
=()
in_sections
=
0
while
IFS
=
read
-r
l
;
do
case
$l
in
"["
project.optional-dependencies
"]"
)
in_sections
=
1
;;
...
...
@@ -283,6 +284,28 @@ print(*set(packages))
EOF
}
_pdm_scripts
()
{
local
scripts
=()
package_dir
=
$(
$PDM_PYTHON
-m
pdm info
--packages
)
if
[[
-f
pyproject.toml
]]
;
then
local
l
in_scripts
=
0
while
IFS
=
read
-r
l
;
do
case
$l
in
"["
tool.pdm.scripts
"]"
)
in_scripts
=
1
;;
"["
*
"]"
)
in_scripts
=
0
;;
*
"= "
*
)
if
((
in_scripts
))
;
then
scripts+
=
$l
[(
w
)
1]
fi
;;
esac
done
< pyproject.toml
fi
if
[[
$package_dir
!=
"None"
]]
;
then
scripts+
=(
$package_dir
/bin/
*
(
N:t
))
fi
echo
$scripts
}
_pdm_packages
()
{
if
[[
!
-f
pyproject.toml
]]
;
then
_message
"not a pdm project"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录