aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
396 stars 82 forks source link

`aiken blueprint apply` works with the 1st parameter only #927

Open Fell-x27 opened 2 months ago

Fell-x27 commented 2 months ago

What Git revision are you using?

aiken v1.0.26-alpha+075668b

What operating system are you using, and which version?

Describe what the problem is?

The aiken blueprint apply asks only for the first parameter and ignores others.

What should be the expected behavior?

The command should parse more than one parameter.

KtorZ commented 2 months ago

That is the expected behavior. Parameters are applied one-by-one, and the command must be called multiple times. One for each parameter.

This isn't set in stone, but I'd like to understand what problems does this cause?

Fell-x27 commented 2 months ago

but I'd like to understand what problems does this cause

1) It doesn't update the blueprint by itself, so if I call it twice, the second attempt will be the same as the first one. 2) Yes, it shows the updated blueprint in CLI, so I can write it to the file manually, but if I call it like

aiken blueprint apply -v oneshot.gift_card > plutus.json

I get:

      Analyzing blueprint
      Summary 1 error, 0 warnings

in the output and...

   × EOF while parsing a value at line 1 column 0
  help: EOF while parsing a value at line 1 column 0

in the file, so the blueprint has been destroyed.

Looks like there is some kind of a bug anyway. Yes, I can rewrite the blueprint by many other ways, even with copy-paste, but it's a UX problem anyway I think. Writing with ">" shouldn't act like this...

Fell-x27 commented 2 months ago

Oh, I see, there is the -o flag for this. But it's still a UX issue. It would be much better if it allowed setting all parameters within the same call step by step, and then asked for the filename to save, using the old one by default. This would provide a smoother and more user-friendly experience.

rvcas commented 2 months ago

@Fell-x27 thanks for the comments, we'll give this some thoughts and see what we can cook up using your advice

Fell-x27 commented 2 months ago

@Fell-x27 thanks for the comments, we'll give this some thoughts and see what we can cook up using your advice

Thanks. Just want to say - I'm totally in love with Aiken, guys! You did an amazing work!