Coverage for sparkle/CLI/about.py: 73%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-05 14:48 +0000

1#!/usr/bin/env python3 

2"""Sparkle command to show information about Sparkle.""" 

3import sys 

4import argparse 

5import sparkle 

6 

7 

8def parser_function() -> argparse.ArgumentParser: 

9 """Define the command line arguments. 

10 

11 Returns: 

12 The argument parser. 

13 """ 

14 parser = argparse.ArgumentParser("Show information about Sparkle.") 

15 return parser 

16 

17 

18def main(argv: list[str]) -> None: 

19 """Main function of the command.""" 

20 print("\n".join([ 

21 f"Sparkle ({sparkle.about.description})", 

22 f"Version: {sparkle.about.version}", 

23 f"Licence: {sparkle.about.licence}", 

24 f'Written by {", ".join(sparkle.about.authors[:-1])},\ 

25 and {sparkle.about.authors[-1]}', 

26 f"Contact: {sparkle.about.contact}", 

27 "For more details see README.md"])) 

28 sys.exit() 

29 

30 

31if __name__ == "__main__": 

32 main(sys.argv[1:])