Skip to content

Commit ad54992

Browse files
committed
change name of cli param and adapt for new mfp_to_yaml function
1 parent 11332f8 commit ad54992

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/virtualship/cli/commands.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
type=click.Path(exists=False, file_okay=False, dir_okay=True),
2626
)
2727
@click.option(
28-
"--mfp_file",
28+
"--mfp-file",
2929
type=str,
3030
default=None,
3131
help='Partially initialise a project from an exported xlsx or csv file from NIOZ\' Marine Facilities Planning tool (specifically the "Export Coordinates > DD" option). User edits are required after initialisation.',
@@ -34,7 +34,7 @@ def init(path, mfp_file):
3434
"""
3535
Initialize a directory for a new expedition, with an example schedule and ship config files.
3636
37-
If --mfp_file is provided, it will generate the schedule from the MPF file instead.
37+
If --mfp-file is provided, it will generate the schedule from the MPF file instead.
3838
"""
3939
path = Path(path)
4040
path.mkdir(exist_ok=True)
@@ -57,12 +57,11 @@ def init(path, mfp_file):
5757
if mfp_file:
5858
# Generate schedule.yaml from the MPF file
5959
click.echo(f"Generating schedule from {mfp_file}...")
60-
mfp_to_yaml(
61-
mfp_file, str(path)
62-
) # Pass the path to save in the correct directory
60+
schedule_body = mfp_to_yaml(mfp_file)
6361
else:
6462
# Create a default example schedule
65-
schedule.write_text(utils.get_example_schedule())
63+
schedule_body = utils.get_example_schedule()
64+
schedule.write_text(schedule_body)
6665

6766
click.echo(f"Created '{config.name}' and '{schedule.name}' at {path}.")
6867

0 commit comments

Comments
 (0)