点击:将原始命令作为字符串获取
我正在使用单击来构建命令行应用程序。出于审核目的,需要获取用户执行的访问完整的原始命令。在单击解析参数之前,我无法获得原始用户命令。我的文档中找不到任何类似的用例。类似:
@click.group()
@click.option('--debug/--no-debug', default=False)
@click.pass_context
def cli(ctx, debug):
if debug:
# print('Original unparssed command with arguments')
我想检查是否有人知道在Github上打开问题之前就可以获取它。
I'm using the Click to build a command-line application. For audit purposes, need to get access full original command that the user executed. I had no luck getting the original user command before the Click parsing arguments. I couldn't find any similar use case in their documentation. something like :
@click.group()
@click.option('--debug/--no-debug', default=False)
@click.pass_context
def cli(ctx, debug):
if debug:
# print('Original unparssed command with arguments')
I wanted to check if anyone knows a trick to get that before opening an issue on the github.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论