Revert "Add history command (#643)" (#658)

This reverts commit d1118f2cbb.
This commit breaks tab autocompletion.
pull/657/head
Jan Mazur 7 years ago committed by Disconnect3d
parent 10aa11d52b
commit 9b6d412db4

@ -1,2 +0,0 @@
.. autoprogram:: pwndbg.commands.history:parser
:prog: history

@ -30,7 +30,6 @@ import pwndbg.commands.gdbinit
import pwndbg.commands.got
import pwndbg.commands.heap
import pwndbg.commands.hexdump
import pwndbg.commands.history
import pwndbg.commands.ida
import pwndbg.commands.leakfind
import pwndbg.commands.misc

@ -81,8 +81,6 @@ class Command(gdb.Command):
"""Invoke the command with an argument string"""
try:
args, kwargs = self.split_args(argument)
# skip all None kwargs so we don't have to pass default values twice in argparse and function
kwargs = {k: v for k, v in kwargs.items() if v is not None}
except SystemExit:
# Raised when the usage is printed by an ArgparsedCommand
return

@ -1,28 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Display the history.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import readline
import gdb
import pwndbg.commands
parser = argparse.ArgumentParser()
parser.description = __doc__
parser.add_argument('count', type=int, nargs='?',
help='The amount of history entries to display')
@pwndbg.commands.ArgparsedCommand(parser)
def history(count=10):
history_length = readline.get_current_history_length()
history = reversed([readline.get_history_item(i) for i in range(history_length)])
history = list(history)[:min(count, history_length)]
for entry in history:
print(entry)
Loading…
Cancel
Save