question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What should show in cmd2 history?

See original GitHub issue

@kotfu @tleonhardt This question pertains to cmd2’s history and not readline’s.

Currently we put what the user typed in history. (statement.raw) Is there any reason why can’t put what was run instead? (statement.command_and_args)

That would make it clearer when things like shortcuts and aliases are entered. You will have a record of what actually occurred.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
kotfucommented, Sep 27, 2018

I like all of this. One suggestion: lets add a deep copy of the Statement object to the HistoryItem instead of raw, command and args, etc. That way we are sure to have everything we might ever need, and can continue to encapsulate any code to split/join parts of the statement into that class.

1reaction
tleonhardtcommented, Sep 27, 2018

@lancestarr I like the idea of history -v only showing both if they are different.

For transcript output, it actually re-runs the commands and generates a transcript for regression testing. I know this feature is a little confusing, but it is actually used by end users for their testing purposes. Generating a transcript in this fashion is typically much easier than doing it by hand. Perhaps we could clarify the help text for the -t flag to make it more clear. And yes, people really care about transcript output - I’m aware of one end user who no longer writes unit tests and writes transcript tests instead.

The Transcript based testing section of the cmd2 docs contains more info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

History — cmd2 2.4 documentation - Read the Docs
The cmd module from the Python standard library includes readline history. ... For example, if you give -1 it will display the last...
Read more >
cmd2 Documentation - Read the Docs
cmd2 tracks the history of the commands that users enter. As a developer, you don't need to do anything to enable.
Read more >
cmd2 · PyPI
Feature Overview · By design, this history does NOT persist between application runs · If you wish to exclude some of your custom...
Read more >
Bash command completion with full path expansion injected ...
pushd ~/bin/x/y/cmd1.sh pushd ~/bin/a/b/cmd2.sh pushd /ppp/n/m/cmd3.sh pushd ~ ... The solutions that I will show will offer up basenames of ...
Read more >
Key Sequence Broadcaster History - Support - Royal Apps
Can we implement a feature so key sequence broadcaster shows a history of previous last ... I'm not sure how a history could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found