模拟AWS CLI/gcloud命令行参数

2024-04-24 16:27:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我有与Auth0接口的实用程序脚本。我想将它们组合成一个类似于gcloud和awscli的工具:

$ gcloud [module] [commands & args]
$ aws cloudformation validate-template --template-body file://test.yml

$ auth0 user add --email [EMAIL] ...
$ auth0 connection backup --connection [CXD_ID]
$ auth0 [user | connection | client | ...]

我不认为我能用argparse做到这一点,因为它将不带前导破折号的arg视为强制位置arg,但我肯定不是专家。你知道吗


Tags: 工具实用程序脚本awsargargstemplateconnection