diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 9b561889a..6e1a38cae 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -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" @@ -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"