diff --git a/jrnl/args.py b/jrnl/args.py index 4b2ba8ce..15c0731e 100644 --- a/jrnl/args.py +++ b/jrnl/args.py @@ -121,18 +121,19 @@ def parse_args(args=[]): ) standalone.add_argument( "--import", - action="store_const", metavar="TYPE", - const=postconfig_import, - dest="postconfig_cmd", + dest="import_format", + nargs="?", + choices=IMPORT_FORMATS, + default="jrnl", help=f""" Import entries from another journal. + TYPE is the format to import [{util.oxford_list(IMPORT_FORMATS)}] (default: jrnl) + Optional parameters: --file FILENAME (default: uses stdin) - - --format [{util.oxford_list(IMPORT_FORMATS)}] (default: jrnl) """, ) standalone.add_argument( diff --git a/jrnl/commands.py b/jrnl/commands.py index a96a2956..0a036a41 100644 --- a/jrnl/commands.py +++ b/jrnl/commands.py @@ -69,8 +69,7 @@ def postconfig_import(args, config, **kwargs): # Requires opening the journal journal = open_journal(args.journal_name, config) - format = args.export if args.export else "jrnl" - get_importer(format).import_(journal, args.filename) + get_importer(args.import_format).import_(journal, args.filename) def postconfig_encrypt(args, config, original_config, **kwargs):