Skip to content

Commit

Permalink
Merge pull request canonical#122 from canonical/doc/howto-grammar
Browse files Browse the repository at this point in the history
docs: update wording in howtos.rst
  • Loading branch information
facundobatista authored Sep 22, 2022
2 parents 2e46e22 + c2dd434 commit 3b56aa4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/howtos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ The ``dispatcher.pre_parse_args`` method returns the global arguments already pa
app_config.set_secure_mode(global_args["secure_mode"])


Set a default command in the application
========================================
Set a default command for the application
=========================================

To allow the application to run a command if none was given in the command line, you need to set a default command in the application when instantiating :class:`craft_cli.dispatcher.Dispatcher`::

Expand All @@ -155,10 +155,10 @@ And even run the specified default command if options are given for that command
$ my-super-app --important-option


Allow temporarily other application to control the terminal
===========================================================
Temporarily allow another application to control the terminal
=============================================================

To be able to run another application (in other process) without interfering in the use of the terminal between the main application and the sub-executed one, you need to pause the emitter::
To be able to run another application (another process) without interfering in the use of the terminal between the main application and the sub-executed one, you need to pause the emitter::

with emit.pause():
subprocess.run(["someapp"])
Expand All @@ -168,8 +168,8 @@ When the emitter is paused the terminal is freed, and the emitter does not have
The normal behaviour is resumed when the context manager exits (even if an exception was raised inside).


Create unit tests for code that uses Craft CLI Emitter
======================================================
Create unit tests for code that uses Craft CLI's Emitter
========================================================

The library provides two fixtures that simplifies the testing of code using the Emitter when using ``pytest``.

Expand Down

0 comments on commit 3b56aa4

Please sign in to comment.