cirocosta / asciinema-edit

asciinema casts post-production tools
https://ops.tips
MIT License
316 stars 22 forks source link

Always getting flag provided but not set errors #8

Closed cookiengineer closed 6 years ago

cookiengineer commented 6 years ago

When I try to use asciinema-edit in order to cut out some unnecessary frames, I always get the same error.

[$] cat install-whatever.cast | asciinema-edit cut --from=50.0 --to=537.0 --out install-fixed.cast
Incorrect Usage: flag provided but not defined: -from

I also tried out using -from "50.0" and -from="50.0" syntax. All the same behaviours.

cookiengineer commented 6 years ago

Why are the flags start and end in the code, but help output says from and to? What's the difference? I was assuming start and end are the "overall file limitations" and not the frame I want to cut out from the file.

Link: https://github.com/cirocosta/asciinema-edit/blob/master/commands/cut.go#L68

cookiengineer commented 6 years ago

When I try to use --start= and --end= I get the following errors:

[$] asciinema-edit cut --start=50.0 --end=537.0 install-whatever.cast
failed to decode cast from input: couldn't decode header: json: unknown field "idle_time_limit"
cookiengineer commented 6 years ago

When I remove all JSON properties that come up in the first line of the .cast file ("title", "idle_time_limit") then the asciinema-edit binary fails with:

[$] asciinema-edit cut --start=50.0 --end=537.0 install-lycheejs.cast
failed to transform cast: couldn't find initial frame
cirocosta commented 6 years ago

Hey @cookiengineer ,

Thx for the feedback!

Regarding your last comment, I just filled #9 and for the --start and --from issue, I updated the CLI help (#10).

Internally, I use to and from everywhere, but I felt that in the CLI, from and to looked a bit weird, so I kept the flag parsing with what I thought was a better name and didn't rename it internally.

Please let me know if you still face such issues or if you spot something else that seems weird.

thx!