Skip to content

Commit

Permalink
fix _check_args
Browse files Browse the repository at this point in the history
  • Loading branch information
BakerNet committed Apr 16, 2024
1 parent 9773fc4 commit 8ee16b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keyring/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def run(self, argv):

def _check_args(self):
if self.operation:
if self.service is None or (self.operation != "getcreds" and self.username is None):
if self.operation == 'getcreds':
if self.service is None :
self.parser.error(f"{self.operation} requires service")
elif self.service is None or self.username is None:
self.parser.error(f"{self.operation} requires service and username")

def do_get(self):
Expand Down

0 comments on commit 8ee16b6

Please sign in to comment.