Task #3772
closedndnputchunks: improve --help text
100%
Description
Current, ndnputchunks -h prints:
Usage: ndnputchunks [options] ndn:/name
However, using this command doesn't do anything and doesn't give a useful error message.
The real expected usage is:
Usage: ndnputchunks [options] ndn:/name < /PATH/FILENAME
I suggest to change the help output and also to print an error message when the user omits the file.
Updated by Davide Pesavento over 7 years ago
- Subject changed from ndnputchunks help usage info to ndnputchunks: improve --help text
I suggest to change the help output
The help text should say that the tool expects data from the standard input, but we should not include shell redirection syntax in the "Usage" line. How the data is piped into stdin is not our problem (and there are many ways to do it).
and also to print an error message when the user omits the file.
There's no way to implement this. ndnputchunks
doesn't know if it has been given a file or not. All it sees is the standard input stream, and reads whatever has been piped into it by the shell or another program.
Updated by Anonymous over 7 years ago
Davide Pesavento wrote:
I suggest to change the help output
The help text should say that the tool expects data from the standard input, but we should not include shell redirection syntax in the "Usage" line. How the data is piped into stdin is not our problem (and there are many ways to do it).
I agree.
and also to print an error message when the user omits the file.
There's no way to implement this.
ndnputchunks
doesn't know if it has been given a file or not. All it sees is the standard input stream, and reads whatever has been piped into it by the shell or another program.
Maybe instead of using a pipe, you can (optionally) use the filename as a parameter?
Like:
ndnputchunks [options] filename ndn:/name
Updated by Weiwei Liu over 7 years ago
https://gerrit.named-data.net/3237
@Davide, are we going to switch to "ndnputchunks [options] filename ndn:/name" as suggested by Klaus? For now I just added some notes in the help text.
Updated by Davide Pesavento over 7 years ago
- Status changed from New to In Progress
Weiwei Liu wrote:
@Davide, are we going to switch to "ndnputchunks [options] filename ndn:/name" as suggested by Klaus? For now I just added some notes in the help text.
I personally don't like it, as it would make the implementation slightly uglier, but I don't have any authority to say what must or must not be done. Let's see what others think too and try to find some consensus.
Updated by Junxiao Shi over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100