File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1835,7 +1835,7 @@ Sub-commands
18351835 .. versionadded :: 3.13
18361836
18371837 One particularly effective way of handling subcommands is to combine the use
1838- of the :meth: `add_subparsers ` method with calls to :meth: `set_defaults ` so
1838+ of the :meth: `~ArgumentParser. add_subparsers ` method with calls to :meth: `~ArgumentParser. set_defaults ` so
18391839 that each subparser knows which Python function it should execute. For
18401840 example::
18411841
@@ -1871,12 +1871,12 @@ Sub-commands
18711871 >>> args.func(args)
18721872 ((XYZYX))
18731873
1874- This way, you can let :meth: `parse_args ` do the job of calling the
1874+ This way, you can let :meth: `~ArgumentParser. parse_args ` do the job of calling the
18751875 appropriate function after argument parsing is complete. Associating
18761876 functions with actions like this is typically the easiest way to handle the
18771877 different actions for each of your subparsers. However, if it is necessary
18781878 to check the name of the subparser that was invoked, the ``dest `` keyword
1879- argument to the :meth: `add_subparsers ` call will work::
1879+ argument to the :meth: `~ArgumentParser. add_subparsers ` call will work::
18801880
18811881 >>> parser = argparse.ArgumentParser()
18821882 >>> subparsers = parser.add_subparsers(dest='subparser_name')
You can’t perform that action at this time.
0 commit comments