From 3a47d3620a0efaf8a9b4c8a9d0f43b484a3e9d39 Mon Sep 17 00:00:00 2001 From: Martial Himanshu Date: Mon, 3 Jan 2022 14:15:29 +0530 Subject: [PATCH 1/2] Typo improvement for using CLI Updated few formatting of text for improvement of this document. --- docs/using-cli.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/using-cli.md b/docs/using-cli.md index 0f369a9a..f456140d 100644 --- a/docs/using-cli.md +++ b/docs/using-cli.md @@ -57,7 +57,7 @@ If your command corresponds to a list or tuple, you can extend your command by adding the index of an element of the component to your command as an argument. For example, `widget function-that-returns-list 2` will correspond to item 2 of -the result of function_that_returns_list. +the result of `function_that_returns_list`. ### Calling a function @@ -90,7 +90,7 @@ See also the section on [Changing the Separator](#separator-flag). ### Instantiating a class If your command corresponds to a class, you can extend your command by adding -the arguments of the class's \_\_init\_\_ function. Arguments must be specified +the arguments of the class's `__init__` function. Arguments must be specified by name, using the flags syntax. See the section on [calling a function](#calling-a-function) for more details. @@ -105,8 +105,8 @@ after the final standalone `--` argument. (If there is no `--` argument, then no arguments are used for flags.) For example, to set the alsologtostderr flag, you could run the command: -`widget bang --noise=boom -- --alsologtostderr`. The --noise argument is -consumed by Fire, but the --alsologtostderr argument is treated as a normal +`widget bang --noise=boom -- --alsologtostderr`. The `--noise` argument is +consumed by Fire, but the `--alsologtostderr` argument is treated as a normal Flag. All CLIs built with Python Fire share some flags, as described in the next @@ -141,9 +141,9 @@ interactively using Python. ### `--completion`: Generating a completion script Call `widget -- --completion` to generate a completion script for the Fire CLI -`widget`. To save the completion script to your home directory, you could e.g. +`widget`. To save the completion script to your home directory, for e.g. you could run `widget -- --completion > ~/.widget-completion`. You should then source this -file; to get permanent completion, source this file from your .bashrc file. +file; to get permanent completion, source this file from your `.bashrc` file. Call `widget -- --completion fish` to generate a completion script for the Fish shell. Source this file from your fish.config. @@ -174,7 +174,7 @@ corresponds to, as well as usage information for how to extend that command. ### `--trace`: Getting a Fire trace In order to understand what is happening when you call Python Fire, it can be -useful to request a trace. This is done via the --trace flag, e.g. +useful to request a trace. This is done via the `--trace` flag, e.g. `widget whack 5 -- --trace`. A trace provides step by step information about how the Fire command was From cbce4735a2fa7324f196b79a25d6b2c95f5c980c Mon Sep 17 00:00:00 2001 From: David Bieber Date: Fri, 9 Dec 2022 15:44:12 -0500 Subject: [PATCH 2/2] Update usage of e.g. --- docs/using-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/using-cli.md b/docs/using-cli.md index f456140d..9f6b14b0 100644 --- a/docs/using-cli.md +++ b/docs/using-cli.md @@ -141,7 +141,7 @@ interactively using Python. ### `--completion`: Generating a completion script Call `widget -- --completion` to generate a completion script for the Fire CLI -`widget`. To save the completion script to your home directory, for e.g. you could +`widget`. To save the completion script to your home directory, you could e.g. run `widget -- --completion > ~/.widget-completion`. You should then source this file; to get permanent completion, source this file from your `.bashrc` file.