浏览代码

cli: adjust 'message' argument parsing to require a value

As per the Python `getopt` documentation[1], add an equals symbol to
require that the message option has a corresponding value (argument).

[1] - https://docs.python.org/3.9/library/getopt.html#getopt.getopt
James Addison 3 周之前
父节点
当前提交
e30be156f4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      dulwich/cli.py

+ 2 - 2
dulwich/cli.py

@@ -321,14 +321,14 @@ class cmd_clone(Command):
 
 
 class cmd_commit(Command):
 class cmd_commit(Command):
     def run(self, args) -> None:
     def run(self, args) -> None:
-        opts, args = getopt(args, "", ["message"])
+        opts, args = getopt(args, "", ["message="])
         kwopts = dict(opts)
         kwopts = dict(opts)
         porcelain.commit(".", message=kwopts["--message"])
         porcelain.commit(".", message=kwopts["--message"])
 
 
 
 
 class cmd_commit_tree(Command):
 class cmd_commit_tree(Command):
     def run(self, args) -> None:
     def run(self, args) -> None:
-        opts, args = getopt(args, "", ["message"])
+        opts, args = getopt(args, "", ["message="])
         if args == []:
         if args == []:
             print("usage: dulwich commit-tree tree")
             print("usage: dulwich commit-tree tree")
             sys.exit(1)
             sys.exit(1)