mprimi / nasefa

Send and receive files using NATS
MIT License
46 stars 2 forks source link

send bundle always requires a file yet CLI indicate it does not #2

Open gedw99 opened 2 years ago

gedw99 commented 2 years ago
cd ./01 && /Users/apple/workspace/go/bin/nasefa send -bundleName b01
❌ Usage error: must provide at least one file

make: *** [01-send] Error 2

with a file it works

make 01-send
cd ./01 && /Users/apple/workspace/go/bin/nasefa send -bundleName b01 ./../text-01.txt
ℹ️ Created file bundle 'b01'
ℹ️ Uploading file 1/1: ./../text-01.txt
✅ Done

Yet the CLI seems to be saying that no file is needed:

nasefa send -h
send [options] <file> ... 
  -bundleName string
        Unique ID for this file bundle, used for download (randomly generated if not provided)
  -expire duration
        Automatically delete this file bundle after a certain amount of time
  -to value
        Tag name for recipients in auto-download (can be repeated)
HeCorr commented 2 years ago

-bundleName is part of the [options] and if you look at the output you provided, it clearly says send [options] <file>.

<file> indicates that you must provide a file.

gedw99 commented 2 years ago

Yes i see your point thanks... I did not quite explain myself it seems...

There is an "add" command and so a user can add many files to a bundle, and and then just send what they added. In which can you want to sent without adding a file.

To me the APi command structure is more precise because you add as many as you want and then you send.

You dont caught cause in uncanny valley having to remember to only add 2 files and then add your last file with a send. This makes it harder to build build higher level tooling on top IMHO.

mprimi commented 2 years ago

Thank you for the comments @gedw99 & @HeCorr

The current interface is indeed a little clunky.

At the moment, there's no way to create, add and then finally "send" (i.e. notify). To do what you mention, I could add a send-existing or similar, that just notifies of a bundle created with create+add

HeCorr commented 1 year ago

To do what you mention, I could add a send-existing or similar

why not modify the send behavior to send existing files from the bundle if no file path has been supplied? i.e., make the <file> argument optional and if it's not specified, check and send the whole bundle if it exists. if not, print usage info.

maybe also a flag to make the behavior explicit: nasefa send -bundle (which would ignore the <file> arg).

I think that would be a more user-friendly implementation than adding an extra command.

mprimi commented 1 year ago

I like your proposal.

However as you might have noticed, this project is not currently actively worked on. I would love to get back to it, but realistically I don't think it's going to happen in the next few months.

gedw99 commented 1 year ago

Thanks fair enough. We all have other things going on .

i am happy to refactor it to work with a gui and cli if anyone is interested ?

HeCorr commented 1 year ago

I would love to get back to it, but realistically I don't think it's going to happen in the next few months.

That's totally understandable. I too would contribute if I wasn't busy myself.

i am happy to refactor it to work with a gui and cli if anyone is interested ?

I don't currently use this tool but why not? :) go ahead and have fun