点击:将原始命令作为字符串获取

发布于 2025-02-09 16:37:35 字数 336 浏览 0 评论 0原文

我正在使用单击来构建命令行应用程序。出于审核目的,需要获取用户执行的访问完整的原始命令。在单击解析参数之前,我无法获得原始用户命令。我的文档中找不到任何类似的用例。类似:

@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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文