diff options
| author | Michael DeHaan <mdehaan@redhat.com> | 2008-07-24 14:37:47 -0400 |
|---|---|---|
| committer | Michael DeHaan <mdehaan@redhat.com> | 2008-07-24 14:37:47 -0400 |
| commit | 042379a84cc73c14bfff6465ee40c8237605b670 (patch) | |
| tree | bdae749fedf6d5c7b9f9675910dda69367273c78 /scripts/cobbler-completion | |
| parent | 727bd969e5fc8be1254febf13b8cb807f416f846 (diff) | |
| download | cobbler-042379a84cc73c14bfff6465ee40c8237605b670.tar.gz cobbler-042379a84cc73c14bfff6465ee40c8237605b670.tar.xz cobbler-042379a84cc73c14bfff6465ee40c8237605b670.zip | |
Apply John V's latest work on bash completion script
Diffstat (limited to 'scripts/cobbler-completion')
| -rwxr-xr-x | scripts/cobbler-completion | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/cobbler-completion b/scripts/cobbler-completion index e4d47010..4889662d 100755 --- a/scripts/cobbler-completion +++ b/scripts/cobbler-completion @@ -15,7 +15,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ import sys -import os import cobbler.yaml as yaml TAKES_A_FILE = [ @@ -32,8 +31,8 @@ def find_completion(args): data = datafile.read() datafile.close() datastruct = yaml.load(data).next() - - if args[0] == "cobbler" or args[0] == "/usr/bin/cobbler": + + if args and args[0] in ["cobbler", "/usr/bin/cobbler"]: args = args[1:] arguments = args @@ -112,7 +111,7 @@ def find_options(datastruct, arguments, last): return datastruct.keys() def clean_output(datastruct): - for x in datastruct.keys(): + for x in sorted(datastruct.keys()): if x is not None: sys.stdout.write("%s " % x.replace("'","-")) print "" |
