summaryrefslogtreecommitdiff
path: root/update_sharing.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2016-05-21 17:54:04 +0200
committerHelmut Grohne <helmut@subdivi.de>2016-05-21 17:54:04 +0200
commit4789c77936a634dc717f61309503f99a44b610ed (patch)
tree40e621b92ae1682709ce1f814ceddcbcebb727bb /update_sharing.py
parent4cdf80c2ba2535f9a4a66d1bde6f7ac1b380e3d2 (diff)
downloaddebian-dedup-4789c77936a634dc717f61309503f99a44b610ed.tar.gz
move from deprecated optparse to argparse
Diffstat (limited to 'update_sharing.py')
-rwxr-xr-xupdate_sharing.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/update_sharing.py b/update_sharing.py
index ca6890b..ac6c945 100755
--- a/update_sharing.py
+++ b/update_sharing.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import optparse
+import argparse
import sqlite3
from dedup.utils import fetchiter
@@ -67,9 +67,9 @@ def main(db):
db.commit()
if __name__ == "__main__":
- parser = optparse.OptionParser()
- parser.add_option("-d", "--database", action="store",
- default="test.sqlite3",
- help="path to the sqlite3 database file")
- options, args = parser.parse_args()
- main(sqlite3.connect(options.database))
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-d", "--database", action="store",
+ default="test.sqlite3",
+ help="path to the sqlite3 database file")
+ args = parser.parse_args()
+ main(sqlite3.connect(args.database))