File: sort.py

package info (click to toggle)
opencc 1.1.6%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,272 kB
  • sloc: cpp: 5,862; python: 352; javascript: 133; makefile: 106; sh: 55
file content (19 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys

from common import sort_items

if len(sys.argv) < 2:
    print("Sort the dictionary")
    print(("Usage: ", sys.argv[0], "[input] ([output])"))
    exit(1)

input = sys.argv[1]

if len(sys.argv) < 3:
    output = input
else:
    output = sys.argv[2]

sort_items(input, output)