From: Fam Zheng <famz@redhat.com>
To: Ishani Chugh <chugh.ishani@research.iiit.ac.in>
Cc: qemu-devel@nongnu.org, jsnow@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 2/3] backup: Adds Backup Tool
Date: Mon, 11 Sep 2017 13:02:00 +0800 [thread overview]
Message-ID: <20170911050200.GB32341@lemon.lan> (raw)
In-Reply-To: <1504888905-22396-3-git-send-email-chugh.ishani@research.iiit.ac.in>
On Fri, 09/08 22:11, Ishani Chugh wrote:
> +def build_parser():
> + backup_tool = BackupTool()
> + parser = ArgumentParser()
> + subparsers = parser.add_subparsers(title='Subcommands',
> + description='Valid Subcommands',
> + help='Subcommand help')
> + guest_parser = subparsers.add_parser('guest', help='Manage guest(s)')
> + guest_subparsers = guest_parser.add_subparsers(title='Guest Subparser')
> +# Guest list
Odd indentation of comments. Please align the # at 4th colume line other code
lines. The same to below.
> + guest_list_parser = guest_subparsers.add_parser('list',
> + help='Lists all guests')
> + guest_list_parser.set_defaults(func=backup_tool.list)
> +
> +# Guest add
> + guest_add_parser = guest_subparsers.add_parser('add', help='Adds a guest')
> + guest_add_required = guest_add_parser.add_argument_group('Required \
> + Arguments')
> + guest_add_required.add_argument('--guest', action='store', type=str,
> + help='Name of the guest', required=True)
> + guest_add_required.add_argument('--qmp', action='store', type=str,
> + help='Path of socket', required=True)
> + guest_add_parser.set_defaults(func=backup_tool.guest_add_wrapper)
> +
> +# Guest Remove
> + guest_remove_parser = guest_subparsers.add_parser('remove',
> + help='Removes a guest')
> + guest_remove_required = guest_remove_parser.add_argument_group('Required \
> + Arguments')
> + guest_remove_required.add_argument('--guest', action='store', type=str,
> + help='Name of the guest', required=True)
> + guest_remove_parser.set_defaults(func=backup_tool.guest_remove_wrapper)
> +
> + drive_parser = subparsers.add_parser('drive',
> + help='Adds drive(s) for backup')
> + drive_subparsers = drive_parser.add_subparsers(title='Add subparser',
> + description='Drive \
> + subparser')
> +# Drive Add
> + drive_add_parser = drive_subparsers.add_parser('add',
> + help='Adds new \
> + drive for backup')
> + drive_add_required = drive_add_parser.add_argument_group('Required \
> + Arguments')
> + drive_add_required.add_argument('--guest', action='store', type=str,
> + help='Name of the guest', required=True)
> + drive_add_required.add_argument('--id', action='store',
> + type=str, help='Drive ID', required=True)
> + drive_add_parser.add_argument('--target', nargs='?',
> + default=None, help='Destination path')
> + drive_add_parser.set_defaults(func=backup_tool.drive_add_wrapper)
> +
> + backup_parser = subparsers.add_parser('backup', help='Creates backup')
> +
> +# Backup
> + backup_parser_required = backup_parser.add_argument_group('Required \
> + Arguments')
> + backup_parser_required.add_argument('--guest', action='store', type=str,
> + help='Name of the guest',
> + required=True)
> + backup_parser.set_defaults(func=backup_tool.fullbackup_wrapper)
> +
> +# Restore
> + restore_parser = subparsers.add_parser('restore', help='Restores drives')
> + restore_parser_required = restore_parser.add_argument_group('Required \
> + Arguments')
> + restore_parser_required.add_argument('--guest', action='store',
> + type=str, help='Name of the guest',
> + required=True)
> + restore_parser.set_defaults(func=backup_tool.restore_wrapper)
> +
> + return parser
> +
> +
> +def main():
> + parser = build_parser()
> + args = parser.parse_args()
> + args.func(args)
> +
> +if __name__ == '__main__':
> + main()
> --
> 2.7.4
>
Fam
next prev parent reply other threads:[~2017-09-11 5:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 16:41 [Qemu-devel] [PATCH v4 0/3] QEMU Backup Tool Ishani Chugh
2017-09-08 16:41 ` [Qemu-devel] [PATCH v4 1/3] Add manpage for " Ishani Chugh
2017-09-15 19:11 ` John Snow
2017-09-18 21:19 ` Ishani
2017-09-08 16:41 ` [Qemu-devel] [PATCH v4 2/3] backup: Adds " Ishani Chugh
2017-09-11 5:02 ` Fam Zheng [this message]
2017-09-13 20:04 ` John Snow
2017-09-15 19:13 ` John Snow
2017-09-18 21:13 ` Ishani
2017-09-08 16:41 ` [Qemu-devel] [PATCH v4 3/3] Test for full Backup Ishani Chugh
2017-09-13 23:14 ` John Snow
2017-09-12 9:20 ` [Qemu-devel] [PATCH v4 0/3] QEMU Backup Tool Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170911050200.GB32341@lemon.lan \
--to=famz@redhat.com \
--cc=chugh.ishani@research.iiit.ac.in \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).