Giter Club home page Giter Club logo

holo-cli's Introduction

holo-cli

holo Command Line Interface

(Doc WIP)

holo-cli's People

Contributors

frederic-loui avatar rwestphal avatar

Watchers

 avatar  avatar

holo-cli's Issues

Fetch interface list from `holod`

For now when we configure holo via holo-cli, interface is entered in a free form.

It would be ideal to be able to configure an interface from holo-cli :

  1. From a list of available physical interfaces

  2. From a list of interface category of interface: te-tunnel, tunnel, bundle, hairpin, etc

  3. Restrict sub-interface creation with . or unit notation form to:
    3.1. Listed physical interface in 1
    3.2. Or logical interface listed in 2

This will enforce configuration consistency.

For 1, it means that holo-cli should be able to query holod->interface list

"NOT FOUND "completion behavior in menu when there is only matching 1 suggestion

holo-cli does not have an expected behavior while completing word when there is only one matching solution.

Example with interfaces -> interface -> <interface-name> ->ip<?>:

Here completion 2 alternatives:
multiple-selection-completion

The last completion should complete to ipv4:
last-selection-completion

However, this is a general problem, when only there is one suggestion left in the completion list and that the cursor postion is right fater the matching word, the menu shows NO RECORDS FOUND. (It should be NO RECORD FOUND BTW)

use of `less -X` in `holo-cli`

When using CLI, network operators are used:

  • to use a buffer in text editor in which they copy paste template (or existing) configuration, adapt it and copy-paste it
  • in lab environment, cli output is useful in order to get hardware state and current running/candiate configuration

Using less in default mode is more visually elegant as it does not clutter CLI terminal screen.
However it is painful to use if you want to copy-paste line from running-config and adapt it in a YOLO mode. ๐Ÿ˜…

It is therefore adviseable to enable less -X behaviour describe here
(man page is precise but "less" human explicit ๐Ÿคฃ)

-X: Leave file contents on screen when less exits.

`holo-cli` should not move to on to a wrong "token"

When trying to apply wrong IPv4 address for example holo-cli should not add the wrong token (and thus update the prompt):

holo(config)# interfaces interface eth3
holo(config/interface[eth3])# ipv4 enabled true
holo(config/interface[eth3])# ipv4 address 1.2.3.455 prefix-length 24
% failed to edit configuration: Unsatisfied pattern - "1.2.3.455" does not conform to "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?".
holo(config/interface[eth3]/address[1.2.3.455])#

The message could be more human/user friendly:

% failed to edit configuration: Unsatisfied pattern - "1.2.3.455" does not conform to "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?".

It can be for example:

% error: invalid ipv4 format

Fetch `interface type` from `ietf` interface yang model

Fetch interface type from ietf interface yang model

For now when we configure holo via holo-cli, interface type is mandatory and entered in a free form.
However, type seems to be a value from ietf-interfaces or ietf-if-extensions yang model

It would be ideal to be able to select interface type from a discrete list built from ietf-interfaces or ietf-if-extensions or other yang model

This will enforce interface configuration consistency

Completion key bindings addition

Most "industry" CLI use mainly 3 shortcuts in order to trigger CLI completion.

  1. <Tab> character
  2. <Space>character
  3. <?> character (mostly triggered in conjunction with <shift>)

JunOS CLI enables the 3 of them above which has the benefit of:

  • working nicely with reedline Completer and Menu.
  • remove command ambiguity by enforcing complete command syntax at CLI prompt.

-> description handling decided here has to disable <space> completion

IOS-XR/XE enables only [1] and [3] :

  • working nicely with reedline Completer and Menu.
  • let the user write incomplete cli command sh run instead of show running-configuration

-> description handling decided here has to adjust with <space> usage
The command entered needs to be "normalized" during Validation step.

JunOS style seems to be easier (reedline library check needed) to implement (granted that object description case can be easily handled)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.