You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
740 B

  1. #!/usr/bin/python
  2. import nilmdb.fsck
  3. import argparse
  4. import os
  5. import sys
  6. def main():
  7. """Main entry point for the 'nilmdb-fsck' command line script"""
  8. parser = argparse.ArgumentParser(
  9. description = 'Check database consistency',
  10. formatter_class = argparse.ArgumentDefaultsHelpFormatter)
  11. parser.add_argument("-V", "--version", action="version",
  12. version = nilmdb.__version__)
  13. parser.add_argument('-y', dest="fix", action="store_true",
  14. default=False, help = 'Fix errors')
  15. parser.add_argument('database', help = 'Database directory')
  16. args = parser.parse_args()
  17. nilmdb.fsck.Fsck(args.database).check(args.fix)
  18. if __name__ == "__main__":
  19. main()