ungana

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README

commit f6bb86018c31996d04ac18cc92540068b8974a15
parent ac2cc774e1e61c098f3512b40124c2c369ab5b93
Author: Carlosokumu <carlosokumu254@gmail.com>
Date:   Mon, 25 Aug 2025 21:36:16 +0300

make ical_file argument positional

Diffstat:
Mungana/cmd/args_parser.py | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ungana/cmd/args_parser.py b/ungana/cmd/args_parser.py @@ -88,8 +88,7 @@ class ArgsParser: edit_event_parser = subparsers.add_parser('edit', help='Edit a calendar ical file') self._add_logging_arguments(edit_event_parser) - edit_event_parser.add_argument("-i", "--ical", required=True, - help="Path to ical file to edit") + edit_event_parser.add_argument("ics_file", help="Path to calendar .ics file") edit_event_parser.add_argument("-a", "--all", action="store_true", help="If your ical file has more than one event, interactively choose one to edit") add_event_field_args(edit_event_parser, required_flags=False) @@ -165,10 +164,10 @@ class ArgsParser: self.ical_manager.save_ical_file(event, filename) def handle_edit(self, args): - if not args.ical: - self.parser.error("missing required ical file path to edit") + if not args.ics_file: + self.parser.error("missing required ical file path to edit") - ical_file_path = args.ical + ical_file_path = args.ics_file try: cal = self.ical_manager.load_ical_file(ical_file_path) except (FileNotFoundError, ValueError): @@ -180,7 +179,7 @@ class ArgsParser: updates, attachments = self._get_user_updates_from_args(args) if any([updates, attachments]): # Non-interactive mode - self.ical_manager.update_event(cal, updates, attachments, args.ical) + self.ical_manager.update_event(cal, updates, attachments, ical_file_path) logging.info("Calendar updated successfully") else: # Interactive mode