From 5f5fbfe08219430adebe326527d17420b567523b Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 30 May 2018 19:27:14 +0200 Subject: [PATCH] Rename `targets` option to `target`. --- kiwixbuild/__init__.py | 6 +++--- kiwixbuild/builder.py | 4 ++-- kiwixbuild/dependencies/kiwix_android.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kiwixbuild/__init__.py b/kiwixbuild/__init__.py index 0f7301c..0c421a6 100644 --- a/kiwixbuild/__init__.py +++ b/kiwixbuild/__init__.py @@ -10,7 +10,7 @@ from . import _global def parse_args(): parser = argparse.ArgumentParser() - parser.add_argument('targets', default='kiwix-tools', nargs='?', metavar='TARGET', + parser.add_argument('target', default='kiwix-tools', nargs='?', metavar='TARGET', choices=Dependency.all_deps.keys()) parser.add_argument('--working-dir', default=".") parser.add_argument('--libprefix', default=None) @@ -23,7 +23,7 @@ def parse_args(): parser.add_argument('--skip-source-prepare', action='store_true', help="Skip the source download part") parser.add_argument('--build-deps-only', action='store_true', - help="Build only the dependencies of the specified targets.") + help="Build only the dependencies of the specified target.") parser.add_argument('--build-nodeps', action='store_true', help="Build only the target, not its dependencies.") parser.add_argument('--make-dist', action='store_true', @@ -51,7 +51,7 @@ def parse_args(): help="The size of the zim file.") options = parser.parse_args() - if options.targets == 'kiwix-android-custom': + if options.target == 'kiwix-android-custom': err = False if not options.android_custom_app: print("You need to specify ANDROID_CUSTOM_APP if you " diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 7b45126..758e027 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -18,7 +18,7 @@ class Builder: PlatformInfo.get_platform('neutral', self._targets) platform = PlatformInfo.get_platform(option('target_platform'), self._targets) - self.targetDefs = platform.add_targets(option('targets'), self._targets) + self.targetDefs = platform.add_targets(option('target'), self._targets) def finalize_target_steps(self): steps = [] @@ -95,7 +95,7 @@ class Builder: builderDefs = (tDef for tDef in target_steps() if tDef[0] != 'source') for builderDef in builderDefs: builder = get_target_step(builderDef) - if option('make_dist') and builderName == option('targets'): + if option('make_dist') and builderName == option('target'): print("make dist {} ({}):".format(builder.name, builderDef[0])) builder.make_dist() continue diff --git a/kiwixbuild/dependencies/kiwix_android.py b/kiwixbuild/dependencies/kiwix_android.py index 7c15a2c..4a2de5b 100644 --- a/kiwixbuild/dependencies/kiwix_android.py +++ b/kiwixbuild/dependencies/kiwix_android.py @@ -28,7 +28,7 @@ class KiwixAndroid(Dependency): return deps def build(self): - if option('targets') == 'kiwix-android-custom': + if option('target') == 'kiwix-android-custom': print("SKIP") else: super().build()