diff --git a/src/ankimaker/cli.py b/src/ankimaker/cli.py index 52b8655..c50f7e5 100644 --- a/src/ankimaker/cli.py +++ b/src/ankimaker/cli.py @@ -4,3 +4,6 @@ from ankimaker.commands import cli def main(): cli(prog_name='ankimaker') + +if __name__ == '__main__': + main() diff --git a/src/ankimaker/commands/from_csv.py b/src/ankimaker/commands/from_csv.py index 8a5c5f4..03d8331 100644 --- a/src/ankimaker/commands/from_csv.py +++ b/src/ankimaker/commands/from_csv.py @@ -5,8 +5,8 @@ from ankimaker.tasks import basic_pandas_to_anki @cli.command('csv') -@click.argument('-i', '--input', 'input_file', type=click.Path(exists=True)) -@click.argument('-o', '--output', 'output_file', type=click.Path(exists=False)) +@click.option('-i', '--input', 'input_file', type=click.Path(exists=True)) +@click.option('-o', '--output', 'output_file', type=click.Path(exists=False)) @click.option('-c', '--conf', 'config_file', default=None, type=click.STRING) @click.option('-n', '--name', 'name', default=None, type=click.STRING) def generate_anki( diff --git a/src/ankimaker/tasks/basic_csv_to_anki.py b/src/ankimaker/tasks/basic_csv_to_anki.py index 25b1836..3183c25 100644 --- a/src/ankimaker/tasks/basic_csv_to_anki.py +++ b/src/ankimaker/tasks/basic_csv_to_anki.py @@ -19,7 +19,8 @@ def create_model(): 'qfmt': '
{{Question}}
', 'afmt': '{{FrontSide}}
{{Answer}}
', }, - ]) + ] + ) return my_model