Commit 7095af66 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by Romain Bignon
Browse files

Add subcommands to the bash completion

parent d2988f65
......@@ -14,7 +14,7 @@ _weboob_weboob_config()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="info enable help --insecure --exclude-backends -I update --version disable --backends register -e -b edit confirm modules -h remove cd list add backends ls --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -26,7 +26,7 @@ _weboob_weboob_repos()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e help --insecure -b -I create --exclude-backends -h --version cd backends ls build --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -62,7 +62,7 @@ _weboob_boobathon()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="info tasks remtask help --insecure addtask --exclude-backends -I --version done members cancel close --backends -e leave join -b edit -h cd start backends ls progress --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -74,7 +74,7 @@ _weboob_galleroob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h --version cd backends ls download --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -86,7 +86,7 @@ _weboob_webcontentedit()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e log help --insecure -b edit -I get --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -98,7 +98,7 @@ _weboob_suboob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h --version cd backends ls download --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -110,7 +110,7 @@ _weboob_wetboobs()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e cities help --insecure -b -I --exclude-backends -h --version current backends ls forecasts cd --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -122,7 +122,7 @@ _weboob_boobank()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="profile help --insecure --exclude-backends coming -I --version pocket add_recipient advisor --backends investment -e recipients -b transfer list -h cd backends ls budgea --auto-update history --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -158,7 +158,7 @@ _weboob_booblyrics()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e search help --insecure -b -I get --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -182,7 +182,7 @@ _weboob_monboob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e once run help --insecure -b post -I --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -194,7 +194,7 @@ _weboob_handjoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -206,7 +206,7 @@ _weboob_translaboob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e translate help --insecure -b -I --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -218,7 +218,7 @@ _weboob_videoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search play help --insecure -b -I --exclude-backends -h --version cd backends nsfw ls playlist download --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -242,7 +242,7 @@ _weboob_flatboob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h load --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -254,7 +254,7 @@ _weboob_radioob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search play help --insecure -b -I --exclude-backends -h --version cd backends ls playlist download --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -278,7 +278,7 @@ _weboob_geolooc()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e help --insecure -b -I --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -290,7 +290,7 @@ _weboob_weboob_cli()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e help --insecure -b -I --exclude-backends -h --version cd backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -302,7 +302,7 @@ _weboob_parceloob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info help --insecure -b track -I --exclude-backends -h --version cd untrack backends status ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -326,7 +326,7 @@ _weboob_cineoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="getfile_subtitle info_movie help --insecure persons_in_common -I cd search_subtitle info_subtitle --backends search_torrent biography search_movie -e getfile_torrent -b -h backends ls search_person --auto-update info_torrent search_movie_subtitle --nss casting releases --exclude-backends --version filmography search_movie_torrent info_person movies_in_common --help"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -338,7 +338,7 @@ _weboob_weboorrents()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h --version cd backends ls getfile --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -350,7 +350,7 @@ _weboob_boobmsg()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="export_all status help --insecure show --exclude-backends -I --version photos profile post --backends -e -b list -h cd backends ls export_thread --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -362,7 +362,7 @@ _weboob_traveloob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e help --insecure -b -I stations --exclude-backends -h --version cd backends departures roadmap ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -374,7 +374,7 @@ _weboob_shopoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e help --insecure -b orders -I --exclude-backends -h --version cd backends ls items payments --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -386,7 +386,7 @@ _weboob_boobill()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="profile help --insecure subscriptions --exclude-backends -I --version download_pdf download --backends -e bills documents -b backends -h cd history ls details --auto-update balance --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -398,7 +398,7 @@ _weboob_boobcoming()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="load info help --insecure --exclude-backends -I --version export unattends --backends -e search -b list -h cd backends attends ls --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -410,7 +410,7 @@ _weboob_boobtracker()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="comment help --insecure get --exclude-backends -I --version post --backends -e search -b edit -h remove cd attach backends ls logtime --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -422,7 +422,7 @@ _weboob_pastoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info get_bin --insecure -b post_bin -I get --exclude-backends -h --version cd post backends ls --auto-update --backends --help help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -434,7 +434,7 @@ _weboob_boobsize()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e history search help --insecure -b -I --exclude-backends -h --version cd backends details last_sensor_measure ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -446,7 +446,7 @@ _weboob_boobooks()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e rented help --insecure -b -I --exclude-backends -h --version cd renew backends ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -458,7 +458,7 @@ _weboob_comparoob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info help --insecure -b -I --exclude-backends -h --version cd backends ls prices --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -482,7 +482,7 @@ _weboob_cookboob()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="-e info search help --insecure -b -I --exclude-backends -h --version cd backends export ls --auto-update --backends --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......@@ -542,7 +542,7 @@ _weboob_havedate()
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
args="-e --insecure -b -I --exclude-backends -h --version --auto-update --backends --help --nss"
args="export_all profile help --insecure show optim --exclude-backends -I --version photos query post --backends -e -b list -h events cd backends status ls export_thread --auto-update --help --nss"
COMPREPLY=( $(compgen -o default -W "${args}" -- "$cur" ) )
}
......
......@@ -486,6 +486,13 @@ def default(self, line):
def completenames(self, text, *ignored):
return [name for name in Cmd.completenames(self, text, *ignored) if name not in self.hidden_commands]
def _shell_completion_items(self):
items = super(ReplApplication, self)._shell_completion_items()
items.update(
set(self.completenames('')) -
set(('debug', 'condition', 'count', 'formatter', 'logging', 'select', 'quit')))
return items
def path_completer(self, arg):
dirname = os.path.dirname(arg)
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment