mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
crit: Explore action and stubs
Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Appreciated-by: avagin@openvz.org
This commit is contained in:
parent
dcd750a64f
commit
075c1c9f08
1 changed files with 17 additions and 0 deletions
17
crit
17
crit
|
|
@ -17,6 +17,8 @@ def outf(opts):
|
|||
else:
|
||||
return sys.stdout
|
||||
|
||||
def dinf(opts, name):
|
||||
return open(os.path.join(opts['dir'], name))
|
||||
|
||||
def decode(opts):
|
||||
indent = None
|
||||
|
|
@ -46,6 +48,15 @@ def info(opts):
|
|||
json.dump(infs, sys.stdout, indent = 4)
|
||||
print
|
||||
|
||||
#
|
||||
# Explorers
|
||||
#
|
||||
|
||||
explorers = { }
|
||||
|
||||
def explore(opts):
|
||||
explorers[opts['what']](opts)
|
||||
|
||||
def main():
|
||||
desc = 'CRiu Image Tool'
|
||||
parser = argparse.ArgumentParser(description=desc,
|
||||
|
|
@ -84,6 +95,12 @@ def main():
|
|||
info_parser.add_argument("in")
|
||||
info_parser.set_defaults(func=info)
|
||||
|
||||
# Explore
|
||||
x_parser = subparsers.add_parser('x', help = 'explore image dir')
|
||||
x_parser.add_argument('dir')
|
||||
x_parser.add_argument('what', choices = [ ])
|
||||
x_parser.set_defaults(func=explore)
|
||||
|
||||
# Show
|
||||
show_parser = subparsers.add_parser('show',
|
||||
help = "convert criu image from binary to human-readable json")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue