Coverage for sparkle/CLI/load_snapshot.py: 0%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-27 09:10 +0000

1#!/usr/bin/env python3 

2"""Sparkle command to load a Sparkle platform from a .zip file.""" 

3import sys 

4import argparse 

5from pathlib import Path 

6 

7from sparkle.CLI.help import snapshot_help 

8from sparkle.CLI.help import logging as sl 

9from sparkle.CLI.help import argparse_custom as ac 

10 

11 

12def parser_function() -> argparse.ArgumentParser: 

13 """Define the command line arguments.""" 

14 parser = argparse.ArgumentParser() 

15 parser.add_argument(*ac.SnapshotArgument.names, 

16 **ac.SnapshotArgument.kwargs) 

17 return parser 

18 

19 

20if __name__ == "__main__": 

21 # Log command call 

22 sl.log_command(sys.argv) 

23 

24 # Define command line arguments 

25 parser = parser_function() 

26 # Process command line arguments 

27 args = parser.parse_args() 

28 snapshot_help.load_snapshot(Path(args.snapshot_file_path))