diff --git a/gpm/cli.py b/gpm/cli.py index a91c68d500757464d06ff47524469b0677386644..4b19805e7f3881b8f7f8215c2b7ac2f6fcce8ba3 100644 --- a/gpm/cli.py +++ b/gpm/cli.py @@ -19,7 +19,7 @@ Commands: current Manage the current profile """ -__VERSION__ = "0.1.1" +__VERSION__ = "0.1.2" __AUTHOR__ = "Leo <alingval@stud.ntnu.no>" from dataclasses import dataclass @@ -152,6 +152,8 @@ class GPM: :param use_global_git_config: Whether to use the global git config or not, when initializing the class """ self.profiles = [] + + self.parser = setup() self._load() # Load profiles from file `data_file` self.use_global_git_config = use_global_git_config @@ -482,8 +484,7 @@ class GPM: Run the Git Profile Manager :return: None """ - parser = setup() - args = parser.parse_args() + args = self.parser.parse_args() if args.command == 'add': self.add(args.name, args.email, args.comment) @@ -503,7 +504,7 @@ class GPM: elif args.current_command == 'remove': self.current_remove() else: - parser.print_help() + self.parser.print_help() elif args.command == 'import': if getattr(args, 'global'): self.use_global_git_config = True @@ -511,7 +512,7 @@ class GPM: elif args.author: print(__AUTHOR__) else: - parser.print_help() + self.parser.print_help() def main(): diff --git a/pyproject.toml b/pyproject.toml index 82f3eb516a7fb3d50b781b8e8b9413bcc3d6566b..36304dc0d6fb8ac052d8198e4826516843cb1597 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gpm" -version = "0.1.1" +version = "0.1.2" description = "Git Profile Management CLI" authors = ["Leo <alingval@stud.ntnu.no>"] license = "MIT"