Project

General

Profile

Actions

Task #3772

closed

ndnputchunks: improve --help text

Added by Anonymous over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
09/10/2016
Due date:
% Done:

100%

Estimated time:

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.

Actions #1

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.

Actions #2

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

Actions #3

Updated by Weiwei Liu over 7 years ago

  • Assignee set to Weiwei Liu
Actions #4

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.

Actions #5

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.

Actions #6

Updated by Junxiao Shi over 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF