0

I am writing a tool that enables a user to traverse a tree-structured data set, which describes a set of roads, each road can have n lanes.

The idle, starting prompt looks like this:

Jeep@CurrentlyDriving>

The user can then traverse to other roads using the DRIVE command

Jeep@CurrentlyDriving> DRIVE Road1

Jeep@CurrentlyDriving\Road1>

The user has the ability to change lanes using the LANE command.

The problem

Should the user use the LANE command (but only if he does so), I want to CLI to reflect that change, i.e, show that a lane has been changed since entering a certain road. i.e,

Jeep@CurrentlyDriving\Road1> LANE 1

Jeep@CurrentlyDriving\Road1????????>

What would be the best way to reflect the lane change (should be reflected where the ???`s are) without significantly 'damaging' the CLI structure?

1 Answer 1

0

Assumptions on usability requirements

Short recap what I understood: in your CLI

  • the promt adapts to user-input given by commands
  • the user should view the current state, i.e. reflect valid commands issued like Road 1 or Lane 1
  • the issued commands build a chain/hierarchy that can be visualized like a path (tree structure)

Visualize the path: commands

A path usually is visualized as concatenation of path-segments separated by a distinctive separator. Compare this to:

  • the bread-crumbs used on web pages to show the current position within the page hierarchy
  • a folder-path displayed in unix-like shell-prompts

This path visualization can also be applied here, e.g using given slash \ as separator:

Jeep@CurrentlyDriving\Road1> LANE 1
Jeep@CurrentlyDriving\Road1\Lane1>

Visualize further details: arguments

To further distinguish the actual command (here: LANE) from its argument or parameter you could insert additional separators. For example a colon : would reveal command details like this:

Jeep@CurrentlyDriving\Road:1> LANE 1
Jeep@CurrentlyDriving\Road:1\Lane:1>

Hope I understood your question & requirements correctly and my suggested visualization supports them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.