提交必要文件
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
|
||||
from m3u_tools import shuffle_text_lines
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="随机打乱文本文件行顺序")
|
||||
parser.add_argument("file", nargs="?", default="pass_test.txt", help="目标文件")
|
||||
parser.add_argument("--no-header", action="store_true", help="不保留第一行注释头")
|
||||
args = parser.parse_args()
|
||||
|
||||
count, path = shuffle_text_lines(args.file, keep_comment_header=not args.no_header)
|
||||
print(f"已打乱 {count} 行:{path}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user