Modified ftp upload behaviour

This commit is contained in:
Nick Bolton 2010-09-10 14:14:52 +00:00
parent 3d21f93dd3
commit e93c892459
3 changed files with 57 additions and 25 deletions

12
hm.py
View file

@ -52,7 +52,8 @@ cmd_opt_dict = {
'update' : ['', []],
'install' : ['', []],
'doxygen' : ['', []],
'dist' : ['', ['ftp-host=', 'ftp-user=', 'ftp-pass=', 'ftp-dir=']],
'dist' : ['', []],
'distftp' : ['', ['host=', 'user=', 'pass=', 'dir=']],
'kill' : ['', []],
'usage' : ['', []],
'revision' : ['', []],
@ -74,10 +75,19 @@ def complete_command(arg):
completions = []
for cmd, optarg in cmd_opt_dict.iteritems():
# if command was matched fully, return only this, so that
# if `dist` is typed, it will return only `dist` and not
# `dist` and `distftp` for example.
if cmd == arg:
return [cmd,]
if cmd.startswith(arg):
completions.append(cmd)
for alias, cmd in cmd_alias_dict.iteritems():
# don't know if this will work just like above, but it's
# probably worth adding.
if alias == arg:
return [alias,]
if alias.startswith(arg):
completions.append(alias)