From 22e22f6412a5454d95d9e692541f9df5ea8d5d14 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Fri, 19 Feb 2016 13:51:26 -0800 Subject: [PATCH] Add Firefox channel aliases --- fftool/main.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/fftool/main.py b/fftool/main.py index a4655c4..c5fff65 100755 --- a/fftool/main.py +++ b/fftool/main.py @@ -2,9 +2,23 @@ import argparse -CHANNELS = ['gr', 'beta', 'aurora', 'nightly', 'ALL'] +CHANNELS = ['gr', 'release', 'stable', 'beta', 'aurora', 'devedition', 'developeredition', 'nightly', 'ALL'] DEFAULT_CHANNEL = 'nightly' +def get_channel(channel): + # Remap some channel names. + channels = { + 'release': 'gr', + 'stable': 'gr', + 'devedition': 'aurora', + 'developeredition': 'aurora' + } + if channel in channels: + return channels[channel] + + return channel + + parser = argparse.ArgumentParser(prog='ff-tool') subparsers = parser.add_subparsers(help='commands', dest='command') @@ -71,6 +85,8 @@ uninstall.add_argument( ) options = parser.parse_args() +if "channel" in options: + options.channel = get_channel(options.channel) if options.command == 'download': print("Downloading Firefox... [channel: {0}]".format(options.channel))