From e959fa780ee0501b7a8fe5e0fbbbbd5be2d9e59a Mon Sep 17 00:00:00 2001 From: freezed <2160318-free_zed@users.noreply.gitlab.com> Date: Fri, 16 Apr 2021 01:51:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Edit=20docstrings=20&=20reuse=20?= =?UTF-8?q?it=20for=20help=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit relate to forga/process/fr/embarquement#6 --- tuto-pysdur/pgcd.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tuto-pysdur/pgcd.py b/tuto-pysdur/pgcd.py index 7d22c65..6618b0c 100755 --- a/tuto-pysdur/pgcd.py +++ b/tuto-pysdur/pgcd.py @@ -2,18 +2,15 @@ # coding: utf8 """ -Author: freezed <2160318-free_zed@users.noreply.gitlab.com> 2021-04-13 -Version: 0.1 -Licence: `GNU GPL v3` GNU GPL v3: http://www.gnu.org/licenses/ +Author: freezed <2160318-free_zed@users.noreply.gitlab.com> 2021-04-13 +Licence: GNU GPL v3 This is a script following https://gitlab.com/forga/process/fr/embarquement/-/issues/6 The goal is to build durable python script using standard library -:Tests: ->>> pgcd(561, 357) -51 +This script compute the greater common divisor of 2 integrers """ @@ -53,8 +50,12 @@ if __name__ == "__main__": # ARGUMENTS, PARAMETERS & OPTIONS import argparse + import sys - PARSER = argparse.ArgumentParser() + PARSER = argparse.ArgumentParser( + description=sys.modules[__name__].__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) PARSER.add_argument("INPUT_A", help="The greater integer", type=int) PARSER.add_argument("INPUT_B", help="The lower integer", type=int) PARSER.add_argument(