Skip to content

Commit

Permalink
Small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvanbrunt committed Sep 18, 2020
1 parent ed3f909 commit 7d58368
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2771,12 +2771,12 @@ def _alias_create(self, args: argparse.Namespace) -> None:
value += ' ' + ' '.join(args.command_args)

# Set the alias
result = "overwritten" if args.name in self.aliases else "created"
self.aliases[args.name] = value

if not args.silent:
result = "overwritten" if args.name in self.aliases else "created"
self.poutput("Alias '{}' {}".format(args.name, result))

self.aliases[args.name] = value

# alias -> delete
alias_delete_help = "delete aliases"
alias_delete_description = "Delete specified aliases or all aliases if --all is used"
Expand Down Expand Up @@ -2980,12 +2980,12 @@ def _macro_create(self, args: argparse.Namespace) -> None:
break

# Set the macro
result = "overwritten" if args.name in self.macros else "created"
self.macros[args.name] = Macro(name=args.name, value=value, minimum_arg_count=max_arg_num, arg_list=arg_list)

if not args.silent:
result = "overwritten" if args.name in self.macros else "created"
self.poutput("Macro '{}' {}".format(args.name, result))

self.macros[args.name] = Macro(name=args.name, value=value, minimum_arg_count=max_arg_num, arg_list=arg_list)

# macro -> delete
macro_delete_help = "delete macros"
macro_delete_description = "Delete specified macros or all macros if --all is used"
Expand Down

0 comments on commit 7d58368

Please sign in to comment.