Fix file name inference
Fix file name inference

When using add command with input files with the form `../file.bin`, the
packaged file name was wrongly inferred. This change required heavy refactor
in `main.rs` to propagate the corresponding error when it occurs.

apoloval/mcp