You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many programs split up their functionality into a number of sub-commands, for example, the svn program can invoke sub-commands like svn checkout, svn update, and svn commit. Splitting up functionality this way can be a particularly good idea when a program performs several different functions which require different kinds of command-line arguments. ArgumentParser supports the creation of such sub-commands with the add_subparsers() method. The add_subparsers() method is normally called with no arguments and returns a special action object. This object has a single method, add_parser(), which takes a command name and any ArgumentParser constructor arguments, and returns an ArgumentParser object that can be modified as usual.
A French translation might be:
De nombreux programmes divisent leurs fonctionnalités en plusieurs sous-commandes. Par exemple, le programme svn peut invoquer des sous-commandes comme svn checkout, svn update et svn commit. Diviser les fonctionnalités de cette manière peut être une bonne idée lorsqu'un programme effectue plusieurs fonctions différentes qui nécessitent différents types d'arguments de ligne de commande. ArgumentParser prend en charge la création de telles sous-commandes avec la méthode add_subparsers(). La méthode add_subparsers() est normalement appelée sans arguments et renvoie un objet d'action spécial. Cet objet a une seule méthode, add_parser(), qui prend un nom de commande et tous les arguments du constructeur ArgumentParser, et renvoie un objet ArgumentParser qui peut être modifié comme d'habitude.
Similarly, when a help message is requested from a subparser, only the help for that particular parser will be printed. The help message will not include parent parser or sibling parser messages. (A help message for each subparser command, however, can be given by supplying the help= argument to add_parser() as above.)
A French translation might be:
De même, lorsqu'un message d'aide est demandé pour un sous-analyseur, seule l'aide pour cet analyseur particulier sera imprimée. Le message d'aide n'inclura pas les messages de l'analyseur parent ou des analyseurs frères. (Cependant, un message d'aide pour chaque commande de sous-analyseur peut être fourni en passant l'argument help= à add_parser() comme ci-dessus.)
The text was updated successfully, but these errors were encountered:
Documentation
In https://docs.python.org/fr/3/library/argparse.html#sub-commands there are paragraphs in English.
A French translation might be:
A French translation might be:
The text was updated successfully, but these errors were encountered: