1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-26 03:42:04 +03:00

samba-tool: moved takes_optiongroups definition to Command base class

The option groups should be defined at the Command base class level as they are in common across all samba-tool commands.
Major move advantages:
1. more OOP approach
2. enforcing consistency across commands
3. avoiding the need of declaring for every new command

Signed-off-by: Andrew Tridgell <tridge@samba.org>
This commit is contained in:
Giampaolo Lauria
2011-07-15 12:07:03 -04:00
committed by Andrew Tridgell
parent 1dfcb019d2
commit f6fa868489
19 changed files with 23 additions and 240 deletions

View File

@ -5,6 +5,7 @@
#
# Based on the original in EJS:
# Copyright Andrew Tridgell 2005
# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -44,12 +45,6 @@ class cmd_group_add(Command):
synopsis = "%prog group add [options] <groupname>"
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"versionopts": options.VersionOptions,
"credopts": options.CredentialsOptions,
}
takes_options = [
Option("-H", help="LDB URL for database or target server", type=str),
Option("--groupou",
@ -93,12 +88,6 @@ class cmd_group_delete(Command):
synopsis = "%prog group delete <groupname>"
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"versionopts": options.VersionOptions,
"credopts": options.CredentialsOptions,
}
takes_options = [
Option("-H", help="LDB URL for database or target server", type=str),
]
@ -124,12 +113,6 @@ class cmd_group_add_members(Command):
synopsis = "%prog group addmembers <groupname> <listofmembers>"
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"versionopts": options.VersionOptions,
"credopts": options.CredentialsOptions,
}
takes_options = [
Option("-H", help="LDB URL for database or target server", type=str),
]
@ -156,12 +139,6 @@ class cmd_group_remove_members(Command):
synopsis = "%prog group removemembers <groupname> <listofmembers>"
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"versionopts": options.VersionOptions,
"credopts": options.CredentialsOptions,
}
takes_options = [
Option("-H", help="LDB URL for database or target server", type=str),
]