소스 검색

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):
     def run(self, args) -> None:
-        opts, args = getopt(args, "", ["message"])
+        opts, args = getopt(args, "", ["message="])
         kwopts = dict(opts)
         porcelain.commit(".", message=kwopts["--message"])
 
 
 class cmd_commit_tree(Command):
     def run(self, args) -> None:
-        opts, args = getopt(args, "", ["message"])
+        opts, args = getopt(args, "", ["message="])
         if args == []:
             print("usage: dulwich commit-tree tree")
             sys.exit(1)