summaryrefslogtreecommitdiffstats
path: root/ipa-admintools/ipa-findgroup
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2007-12-10 16:12:58 -0500
committerRob Crittenden <rcritten@redhat.com>2007-12-10 16:12:58 -0500
commitf796e50000e5c198a510300e2293ed460e7113aa (patch)
tree5b1af353e5beee3d35b2b5b42fa4631fd9ce238d /ipa-admintools/ipa-findgroup
parent2675f35fdf3121dd23658e4ea89e1600291d2b70 (diff)
downloadfreeipa-f796e50000e5c198a510300e2293ed460e7113aa.tar.gz
freeipa-f796e50000e5c198a510300e2293ed460e7113aa.tar.xz
freeipa-f796e50000e5c198a510300e2293ed460e7113aa.zip
Add simple UI for command-line programs to be able to select when
multiple entries are returned.
Diffstat (limited to 'ipa-admintools/ipa-findgroup')
-rw-r--r--ipa-admintools/ipa-findgroup10
1 files changed, 10 insertions, 0 deletions
diff --git a/ipa-admintools/ipa-findgroup b/ipa-admintools/ipa-findgroup
index 73b0bb1bc..b5a5f0766 100644
--- a/ipa-admintools/ipa-findgroup
+++ b/ipa-admintools/ipa-findgroup
@@ -21,6 +21,7 @@
import sys
from optparse import OptionParser
import ipa.ipaclient as ipaclient
+import ipa.ipaadminutil as ipaadminutil
import ipa.config
import errno
@@ -62,6 +63,7 @@ def main():
counter = groups[0]
groups = groups[1:]
+ groupindex = -1
if counter == 0:
print "No entries found for", args[1]
return 2
@@ -69,6 +71,14 @@ def main():
print "These results are truncated."
print "Please refine your search and try again."
+ if counter > 1:
+ groupindex = ipaadminutil.select_group(counter, groups)
+ if groupindex == "q":
+ return 0
+
+ if groupindex >= 0:
+ groups = [groups[groupindex]]
+
for ent in groups:
try:
members = client.group_members(ent.dn, ['dn','cn'])