Skip to content

Commit

Permalink
Small docs improvement for using CLI (#372)
Browse files Browse the repository at this point in the history
* Updated the formatting of the text to improve the documentation.
  • Loading branch information
mhimanshu0101 authored Dec 9, 2022
1 parent 0ad0571 commit eda25f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/using-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -146,7 +146,7 @@ the `ipython` package needs to be installed in your environment.
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.
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.
Expand Down Expand Up @@ -177,7 +177,7 @@ corresponds to, as well as usage information for how to extend that command.
### `--trace`: Getting a Fire trace <a name="trace-flag"></a>

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
Expand Down

0 comments on commit eda25f8

Please sign in to comment.