Project

General

Profile

Actions

Feature #2542

closed

Redesign nfdc combining nfdc and nfd-status

Added by Alex Afanasyev almost 10 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tools
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

nfd-status can be merged into nfdc, because StatusDataset is the result of executing ControlCommands.
This could reduce confusion for new users and reduce the need to learn multiple commands to control and getting status.

This issue designs the new nfdc program. Implementation will be separate issues.

https://gist.github.com/yoursunny/89de673e0811fecdf54985bf519803d2


Related issues 7 (0 open7 closed)

Related to NFD - Feature #3749: nfdc one-shot modeClosedJunxiao Shi

Actions
Related to NFD - Feature #3780: nfdc status commandsClosedJunxiao Shi

Actions
Related to NFD - Feature #3864: nfdc face commandsClosedJunxiao Shi

Actions
Related to NFD - Feature #3865: nfdc strategy commandsClosedJunxiao Shi

Actions
Related to NFD - Feature #3866: nfdc route commandsClosedJunxiao Shi

Actions
Related to NFD - Feature #5169: nfdc: execute a batch of commands defined in a separate fileClosedAlex Afanasyev06/09/2021

Actions
Has duplicate NFD - Feature #3444: Human friendly output of nfdc commandDuplicateJunxiao Shi

Actions
Actions #1

Updated by Davide Pesavento almost 10 years ago

Sounds reasonable to me.

Actions #2

Updated by Junxiao Shi almost 10 years ago

This could reduce confusion for new users and reduce the need to learn multiple commands

This claim needs to be proved by a user study or survey.


ip did a good job as a combined tool.
Its syntax mostly uses positional parameters, with an extensive online help command.

netsh for Windows and asterisk are also good combined tools.
They are like command interpreters to control all aspects of Windows network drivers / the telephony server.

ssh-keygen is a not-so-good combined tool.
The feature is entirely selected by named flags, and I had to look at manpage every time I need to use any parameter.

We could make nfdc like the good combined tools, but it requires changing command syntax (but old syntax can be accepted) and major refactoring, and would become a much larger Task than just combining. Merely combining the tools doesn't have much value.

Actions #3

Updated by Junxiao Shi over 8 years ago

  • Tracker changed from Task to Feature
  • Subject changed from (Proposal) Combine nfdc with nfd-status to Combine nfdc with nfd-status
  • Description updated (diff)
  • Category set to Tools
  • Estimated time set to 9.00 h
Actions #4

Updated by Junxiao Shi over 8 years ago

https://gist.github.com/yoursunny/89de673e0811fecdf54985bf519803d2/057412b85da47b27032e121db97404a87b0fb136 has a design for the interactions and input/output formats.
I think that's the way it should be.
Full implementation of this design is estimated to be 24 hours, but it can be done in stages.

Actions #5

Updated by Junxiao Shi over 8 years ago

20160809 call Alex approves note-4 design.

Actions #6

Updated by Davide Pesavento over 8 years ago

I like the command line syntax, it is uniform and easily extensible. It seems to be modeled after tools like ip and iw, which I consider well-designed.

I'm questioning the need for an interactive mode though... do we really need it? how much typing would it save? My guess is very little. Command completion doesn't require an interactive mode, bash and zsh support programmable completions and we could implement completion scripts for them.

In any case, if the interactive mode is implemented, I suggest not to reinvent the wheel, and use a library such as GNU readline to support proper command line editing, history, and completion.

Wrt the output format: how does the above design relate to feature #3444? Should we have an explicit flag for outputting in a stable and parseable format, e.g. --machine-readable, or --porcelain à la git? Given that we already have optional XML output for status, the formatter component should already be modular, no? Someone may even want to add JSON output at some point...

Actions #7

Updated by Davide Pesavento over 8 years ago

  • Estimated time changed from 9.00 h to 26.00 h

Adjusting based on note-4 (24 hours for the implementation + 2 hours already spent for the design)

Actions #8

Updated by Junxiao Shi over 8 years ago

  • Subject changed from Combine nfdc with nfd-status to Redesign nfdc combining nfdc and nfd-status
  • Description updated (diff)
  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • Target version set to v0.5
  • % Done changed from 0 to 50
  • Estimated time changed from 26.00 h to 3.00 h

A "24 hours" estimation indicates that the implementation should not be in a single issue.
It's generally recommended to have smaller tasks on the order of 3~6 hours.

I'm reducing this issue to be design only, and will create separate implementation issues once we have a plan.

Actions #9

Updated by Junxiao Shi over 8 years ago

The command line syntax is modeled after ip and nmcli and netsh.

I'm questioning the need for an interactive mode though. Command completion doesn't require an interactive mode, bash and zsh support programmable completions and we could implement completion scripts for them.

The design has interactive mode, but its implementation would be lower priority.

And yes, bash completion is an alternate to interactive mode.

Wrt the output format: how does the above design relate to feature #3444? Should we have an explicit flag for outputting in a stable and parseable format, e.g. --machine-readable, or --porcelain à la git?

It's premature to define a stable output format, because fields returned from commands and datasets change from time to time.
A syntax that is both human-friendly and machine-readable should be good enough; it's not guaranteed to be stable between versions, but it's easier to parse than the old format which has whitespaces everywhere.

Actions #10

Updated by Junxiao Shi over 8 years ago

  • Description updated (diff)
  • % Done changed from 50 to 70

https://gist.github.com/yoursunny/89de673e0811fecdf54985bf519803d2/387f65ef84bc359b5f7dcea1504f69dbf03b5c2e adds a partial implementation plan for:

  1. combine tool and new syntax (9 hours)
  2. new output format (4.5 hours each for face strategy route, plus additional time to fix NFD-integ accordingly)
  3. help command (3 hours)
  4. batch mode (3 hours)

I didn't include:

  • interactive mode
  • deletion of add-nexthop and remove-nexthop commands
Actions #11

Updated by Junxiao Shi over 8 years ago

Actions #13

Updated by Junxiao Shi about 8 years ago

Actions #14

Updated by Junxiao Shi about 8 years ago

  • Description updated (diff)
Actions #15

Updated by Junxiao Shi almost 8 years ago

Actions #16

Updated by Junxiao Shi almost 8 years ago

Actions #17

Updated by Junxiao Shi almost 8 years ago

Actions #18

Updated by Davide Pesavento over 7 years ago

What's left to do here?

Actions #19

Updated by Junxiao Shi over 7 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 70 to 100

Closing because design is done.

Actions #20

Updated by Junxiao Shi about 7 years ago

  • Has duplicate Feature #3444: Human friendly output of nfdc command added
Actions #21

Updated by Davide Pesavento over 3 years ago

  • Related to Feature #5169: nfdc: execute a batch of commands defined in a separate file added
Actions

Also available in: Atom PDF