Skip to content

Conversation

@tleonhardt
Copy link
Member

@tleonhardt tleonhardt commented Mar 4, 2019

Summary

This PR contains numerous changes to the history command made by a mix of @kmvanbrunt, @kotfu, and @tleonhardt over the last few months. It feels like these changes are either done or almost done and it was high time to create a PR and hash out any last remaining details.

Details

Presentation format

The presentation format has been improved and simplified.

Current:

(Cmd) history
    1  help
    2  help history

Before:

(Cmd) history
-------------------------[1]
help
-------------------------[2]
help history

New flags

  • -x, --expanded
    • output expanded commands instead of entered command (expands aliases, macros, and shortcuts)
  • -v, --verbose
    • display history and include expanded commands if they differ from the typed command

Refactoring

  • HistoryItem and History classes were moved from cmd2.py to a new history.py
  • HIstoryItem now retains the full Statement instance
  • Added expanded_command_line property to HistoryItem

Improvements

  • Improved multiline command support for things like outputting history commands to a script file

TODO

  • Final merge from master to pick up changes from other recent PRs
  • Updated CHANGELOG
  • Update Sphinx docs and/or README as we deem necessary
  • Consider adding unit tests

This closes #545

@tleonhardt tleonhardt added this to the 0.9.11 milestone Mar 4, 2019
@tleonhardt tleonhardt requested review from kmvanbrunt and kotfu March 4, 2019 13:30
@codecov
Copy link

codecov bot commented Mar 4, 2019

Codecov Report

Merging #635 into master will increase coverage by 0.14%.
The diff coverage is 98.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #635      +/-   ##
==========================================
+ Coverage   94.07%   94.21%   +0.14%     
==========================================
  Files          10       11       +1     
  Lines        2954     3010      +56     
==========================================
+ Hits         2779     2836      +57     
+ Misses        175      174       -1
Impacted Files Coverage Δ
cmd2/parsing.py 100% <100%> (ø) ⬆️
cmd2/constants.py 100% <100%> (ø) ⬆️
cmd2/history.py 100% <100%> (ø)
cmd2/cmd2.py 94.22% <93.75%> (-0.3%) ⬇️
cmd2/argparse_completer.py 88.42% <0%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb86c73...6370022. Read the comment docs.

@tleonhardt
Copy link
Member Author

@kotfu @kmvanbrunt I hope you don't mind, but I took the liberty of putting this branch we have all contributed to (you two more than me) up for PR. It felt like it was time for the three of us to review the work everyone has done and hash out any remaining changes.

kmvanbrunt
kmvanbrunt previously approved these changes Mar 4, 2019
Copy link
Member

@kmvanbrunt kmvanbrunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks goods. Good team effort on this change.

@kmvanbrunt
Copy link
Member

@kotfu I'm going to merge this PR so I can do a bunch of regression testing of the new features together. Feel free to still suggest changes.

@kmvanbrunt kmvanbrunt self-requested a review March 5, 2019 03:44
@kmvanbrunt kmvanbrunt merged commit dddf5d0 into master Mar 5, 2019
@tleonhardt tleonhardt deleted the history branch March 5, 2019 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What should show in cmd2 history?

4 participants