Skip to content

Fix typos #1346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ You can run multiple tasks in a single invocation, for example::
$ invoke docs sdist wheel
```

That one command will remove all superflous cache, testing, and build
That one command will remove all superfluous cache, testing, and build
files, render the documentation, and build a source distribution and a
wheel distribution.

Expand All @@ -298,7 +298,7 @@ $ cd ~src/cmd2
$ invoke pytest
```

If the tests are executed it means that dependencies and project are installed succesfully.
If the tests are executed it means that dependencies and project are installed successfully.

You can also run the example app and see a prompt that says "(Cmd)" running the command:

Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@
* Enhancements
* Added ability to include command name placeholders in the message printed when trying to run a disabled command.
* See docstring for ``disable_command()`` or ``disable_category()`` for more details.
* Added instance attributes to customize error messages without having to override methods. Theses messages can
* Added instance attributes to customize error messages without having to override methods. These messages can
also be colored.
* `help_error` - the error that prints when no help information can be found
* `default_error` - the error that prints when a non-existent command is run
Expand Down Expand Up @@ -862,7 +862,7 @@
* Aliases are now sorted alphabetically
* The **set** command now tab completes settable parameter names
* Added ``async_alert``, ``async_update_prompt``, and ``set_window_title`` functions
* These allow you to provide feedback to the user in an asychronous fashion, meaning alerts can
* These allow you to provide feedback to the user in an asynchronous fashion, meaning alerts can
display when the user is still entering text at the prompt. See [async_printing.py](https://github.com/python-cmd2/cmd2/blob/master/examples/async_printing.py)
for an example.
* Cross-platform colored output support
Expand Down Expand Up @@ -962,7 +962,7 @@
* New pyscript approach that provides a pythonic interface to commands in the cmd2 application.
* Switch command parsing from pyparsing to custom code which utilizes shlex.
* The object passed to do_* methods has changed. It no longer is the pyparsing object, it's a new Statement object, which is a subclass of ``str``. The statement object has many attributes which give you access to various components of the parsed input. If you were using anything but the string in your do_* methods, this change will require you to update your code.
* ``commentGrammers`` is no longer supported or available. Comments are C-style or python style.
* ``commentGrammars`` is no longer supported or available. Comments are C-style or python style.
* Input redirection no longer supported. Use the load command instead.
* ``multilineCommand`` attribute is ``now multiline_command``
* ``identchars`` is now ignored. The standardlibrary cmd uses those characters to split the first "word" of the input, but cmd2 hasn't used those for a while, and the new parsing logic parses on whitespace, which has the added benefit of full unicode support, unlike cmd or prior versions of cmd2.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


<p align="center">
<a href="#the-developers-toolbox">Develper's Toolbox</a> •
<a href="#the-developers-toolbox">Developer's Toolbox</a> •
<a href="#philosophy">Philosophy</a> •
<a href="#installation">Installation</a> •
<a href="#documentation">Documentation</a> •
Expand Down Expand Up @@ -153,7 +153,7 @@ Projects using cmd2
| [Poseidon](https://github.com/CyberReboot/poseidon) | Leverages software-defined networks (SDNs) to acquire and then feed network traffic to a number of machine learning techniques. | |
| [Unipacker](https://github.com/unipacker/unipacker) | Automatic and platform-independent unpacker for Windows binaries based on emulation | |
| [tomcatmanager](https://github.com/tomcatmanager/tomcatmanager) | A command line tool and python library for managing a tomcat server | |
| [Expliot](https://gitlab.com/expliot_framework/expliot) | Internet of Things (IoT) exploitation framework | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the name of the package and not a typo

| [Exploit](https://gitlab.com/expliot_framework/expliot) | Internet of Things (IoT) exploitation framework | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Expliot" is the name of the software. It's not a typo.

| [mptcpanalyzer]() | Tool to help analyze mptcp pcaps | |
| [clanvas](https://github.com/marklalor/clanvas) | Command-line client for Canvas by Instructure | |

Expand Down
2 changes: 1 addition & 1 deletion cmd2/argparse_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def my_choices_provider(self):
an acceptable value for these arguments.

There are times when what's being tab completed is determined by a previous
argument on the command line. In theses cases, ArgparseCompleter can pass a
argument on the command line. In these cases, ArgparseCompleter can pass a
dictionary that maps the command line tokens up through the one being completed
to their argparse argument name. To receive this dictionary, your
choices/completer function should have an argument called arg_tokens.
Expand Down
2 changes: 1 addition & 1 deletion cmd2/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _escaped_find(regex: str, s: str, start: int, in_regex: bool) -> Tuple[str,
# escaped. We found it.
break
else:
# check if the slash is preceeded by a backslash
# check if the slash is preceded by a backslash
if s[pos - 1 : pos] == '\\':
# it is.
if in_regex:
Expand Down
4 changes: 2 additions & 2 deletions docs/doc_conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ Titles and Headings
-------------------

reStructuredText allows flexibility in how headings are defined. You only have
to worry about the heirarchy of headings within a single file. Sphinx magically
handles the intra-file heirarchy on it's own. This magic means that no matter
to worry about the hierarchy of headings within a single file. Sphinx magically
handles the intra-file hierarchy on it's own. This magic means that no matter
how you style titles and headings in the various files that comprise the
documentation, Sphinx will render properly structured output. To ensure we have
a similar consistency when viewing the source files, we use the following
Expand Down
2 changes: 1 addition & 1 deletion docs/features/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Commands
.. _cmd: https://docs.python.org/3/library/cmd.html

``cmd2`` is designed to make it easy for you to create new commands. These
commmands form the backbone of your application. If you started writing your
commands form the backbone of your application. If you started writing your
application using cmd_, all the commands you have built will work when you move
to ``cmd2``. However, there are many more capabilities available in ``cmd2``
which you can take advantage of to add more robust features to your commands,
Expand Down
2 changes: 1 addition & 1 deletion docs/features/help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Providing Help
``cmd2`` makes it easy for developers of ``cmd2`` applications to provide this
help. By default, the help for a command is the docstring for the ``do_*``
method defining the command - e.g. for a command **foo**, that command is
implementd by defining the ``do_foo`` method and the docstring for that method
implemented by defining the ``do_foo`` method and the docstring for that method
is the help.

For commands which use one of the ``argparse`` decorators to parse arguments,
Expand Down
6 changes: 3 additions & 3 deletions docs/features/hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ object, including ``.raw`` which contains exactly what the user typed.

The hook method must return a :class:`cmd2.plugin.PostparsingData` object, and
it is very convenient to just return the object passed into the hook method.
The hook method may modify the attributes of the object to influece the
The hook method may modify the attributes of the object to influence the
behavior of the application. If ``params.stop`` is set to true, a fatal failure
is triggered prior to execution of the command, and the application exits.

Expand Down Expand Up @@ -287,7 +287,7 @@ Any postcommand hook can change the value of the ``stop`` attribute before
returning it, and the modified value will be passed to the next postcommand
hook. The value returned by the final postcommand hook will be passed to the
command finalization hooks, which may further modify the value. If your hook
blindly returns ``False``, a prior hook's requst to exit the application will
blindly returns ``False``, a prior hook's request to exit the application will
not be honored. It's best to return the value you were passed unless you have a
compelling reason to do otherwise.

Expand Down Expand Up @@ -330,7 +330,7 @@ hook. The value returned by the final command finalization hook will determine
whether the application terminates or not.

This approach to command finalization hooks can be powerful, but it can also
cause problems. If your hook blindly returns ``False``, a prior hook's requst
cause problems. If your hook blindly returns ``False``, a prior hook's request
to exit the application will not be honored. It's best to return the value you
were passed unless you have a compelling reason to do otherwise.

Expand Down
6 changes: 3 additions & 3 deletions docs/features/scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Developing an Advanced API

Until now the application designer has paid little attention to scripters and their needs.
Wouldn't it be nice if while creating py_scripts one did not have to parse data from ``stdout``? We can
accomodate the weary scripter by adding one small line at the end of our ``do_*`` commands.
accommodate the weary scripter by adding one small line at the end of our ``do_*`` commands.

``self.last_result = <value>``

Expand Down Expand Up @@ -446,7 +446,7 @@ app.py::
self._status_cache[args.name] = status

self.poutput(
f"Build {args.name.upper()} successfuly stared with id : {status.id}"
f"Build {args.name.upper()} successfully stared with id : {status.id}"
)
self.last_result = status

Expand Down Expand Up @@ -496,7 +496,7 @@ The below is a possible solution via pyscript::

#error checking
if not result:
print("Unable to determin status")
print("Unable to determine status")
break

build_status = result.data
Expand Down
2 changes: 1 addition & 1 deletion docs/features/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ show all settings and to modify the value of any setting.
allow_style
~~~~~~~~~~~

Output generated by ``cmd2`` programs may contain ANSI escape seqences which
Output generated by ``cmd2`` programs may contain ANSI escape sequences which
instruct the terminal to apply colors or text styling (i.e. bold) to the
output. The ``allow_style`` setting controls the behavior of these escape
sequences in output generated with any of the following methods:
Expand Down
2 changes: 1 addition & 1 deletion docs/migrating/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ Next Steps
----------

In addition to the features you get with no additional work, ``cmd2`` offers a
broad range of additional capabilties which can be easily added to your
broad range of additional capabilities which can be easily added to your
application. :ref:`migrating/next_steps:Next Steps` has some ideas of where
you can start, or you can dig in to all the :ref:`features/index:Features`.
2 changes: 1 addition & 1 deletion docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you need to mock anything in your cmd2 application, and most specifically in
sub-classes of :class:`~cmd2.Cmd` or
:class:`~cmd2.command_definition.CommandSet`, you must use `Autospeccing
<python_mock_autospeccing_>`_, `spec=True <python_mock_patch_>`_, or whatever
equivalant is provided in the mocking library you're using.
equivalent is provided in the mocking library you're using.

In order to automatically load functions as commands cmd2 performs a number of
reflection calls to look up attributes of classes defined in your cmd2
Expand Down
4 changes: 2 additions & 2 deletions plugins/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ required for two reasons:

### Add commands

Your plugin can add user visable commands. You do it the same way in a plugin
Your plugin can add user visible commands. You do it the same way in a plugin
that you would in a `cmd2.Cmd` app:

```python
Expand Down Expand Up @@ -197,7 +197,7 @@ You can run multiple tasks in a single invocation, for example:
$ invoke clean docs sdist wheel
```

That one command will remove all superflous cache, testing, and build
That one command will remove all superfluous cache, testing, and build
files, render the documentation, and build a source distribution and a
wheel distribution.

Expand Down
2 changes: 1 addition & 1 deletion readme_files/shout_out.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Application Name, Description
[Poseidon](https://github.com/CyberReboot/poseidon),Leverages software-defined networks (SDNs) to acquire and then feed network traffic to a number of machine learning techniques.
[Unipacker](https://github.com/unipacker/unipacker),Automatic and platform-independent unpacker for Windows binaries based on emulation
[tomcatmanager](https://github.com/tomcatmanager/tomcatmanager),A command line tool and python library for managing a tomcat server
[Expliot](https://gitlab.com/expliot_framework/expliot),Internet of Things (IoT) exploitation framework
[Exploit](https://gitlab.com/expliot_framework/expliot),Internet of Things (IoT) exploitation framework
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Expliot" is the name of the software. It's not a typo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same name of package not a typo

[mptcpanalyzer](),Tool to help analyze mptcp pcaps
[clanvas](https://github.com/marklalor/clanvas),Command-line client for Canvas by Instructure

Expand Down
6 changes: 3 additions & 3 deletions readme_files/shoutout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Genre:



Name: Microsoft/ Azure Counterfit
Name: Microsoft/ Azure Counterfeit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also name of a package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Azure Counterfit" is the name of the software. It's not a typo.

Source Code: https://github.com/Azure/counterfit
Status: Active
Description: Counterfit is a command-line tool and generic automation layer for assessing the security of machine learning systems.
Description: Counterfeit is a command-line tool and generic automation layer for assessing the security of machine learning systems.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Azure Counterfit" is the name of the software. It's not a typo.

Genre: Security

Name: MQTT-Pwn
Expand Down Expand Up @@ -65,7 +65,7 @@ Genre: utility
Name: icl-rocketry/Avionics
Source Code: https://github.com/icl-rocketry/Avionics
Status: Active
Description: The main repository for hardware and software assosciated with the Ricardo Avionics Ecosystem.
Description: The main repository for hardware and software associated with the Ricardo Avionics Ecosystem.
Genre: Utility


Expand Down
4 changes: 2 additions & 2 deletions tests/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def do_test_subcmd_decorator(self, args: argparse.Namespace):

@cmd2.as_subcommand_to('test_subcmd_decorator', 'subcmd', subcmd_parser, help=subcmd_parser.description.lower())
def subcmd_func(self, args: argparse.Namespace):
# Make sure printing the Namespace works. The way we originally added cmd2_hander to it resulted in a RecursionError.
# Make sure printing the Namespace works. The way we originally added cmd2_handler to it resulted in a RecursionError.
self.poutput(args)

helpless_subcmd_parser = cmd2.Cmd2ArgumentParser(add_help=False, description="A subcommand with no help")
Expand All @@ -321,7 +321,7 @@ def subcmd_func(self, args: argparse.Namespace):
'test_subcmd_decorator', 'helpless_subcmd', helpless_subcmd_parser, help=helpless_subcmd_parser.description.lower()
)
def helpless_subcmd_func(self, args: argparse.Namespace):
# Make sure vars(Namespace) works. The way we originally added cmd2_hander to it resulted in a RecursionError.
# Make sure vars(Namespace) works. The way we originally added cmd2_handler to it resulted in a RecursionError.
self.poutput(vars(args))


Expand Down
2 changes: 1 addition & 1 deletion tests/test_argparse_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ def test_completion_items_descriptive_header(ac_app):
('nargs --one_or_more', '-', True),
# This flag has reached its minimum value count and therefore a new flag could start.
# However the flag can still consume values and the text is not a single prefix character.
# Therefor a hint will be shown.
# Therefore a hint will be shown.
('nargs --one_or_more choices', 'bad_completion', True),
# Like the previous case, but this time text is a single prefix character which will cause flag
# name completion to occur instead of a hint for the current flag.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def test_raise_keyboard_interrupt(base_app):
assert 'Got a keyboard interrupt' in str(excinfo.value)


@pytest.mark.skipif(sys.platform.startswith('win'), reason="SIGTERM only handeled on Linux/Mac")
@pytest.mark.skipif(sys.platform.startswith('win'), reason="SIGTERM only handled on Linux/Mac")
def test_termination_signal_handler(base_app):
with pytest.raises(SystemExit) as excinfo:
base_app.termination_signal_handler(signal.SIGHUP, 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def test_shell_command_completion_does_path_completion_when_after_command(cmd2_a
assert first_match is not None and cmd2_app.completion_matches == [text + '.py ']


def test_shell_commmand_complete_in_path(cmd2_app, request):
def test_shell_command_complete_in_path(cmd2_app, request):
test_dir = os.path.dirname(request.module.__file__)

text = os.path.join(test_dir, 's')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def test_parse_output_to_paste_buffer(parser):


def test_parse_redirect_inside_terminator(parser):
"""The terminator designates the end of the commmand/arguments portion.
"""The terminator designates the end of the command/arguments portion.
If a redirector occurs before a terminator, then it will be treated as
part of the arguments and not as a redirector."""
line = 'has > inside;'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def reset_counters(self):
###
#
# preloop and postloop hooks
# which share the same signature and are thus interchangable
# which share the same signature and are thus interchangeable
#
###
def prepost_hook_one(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,16 +876,16 @@ def test_find_editor_not_specified():


def test_similarity():
suggested_command = cu.suggest_similar("comand", ["command", "UNRELATED", "NOT_SIMILAR"])
suggested_command = cu.suggest_similar("command", ["command", "UNRELATED", "NOT_SIMILAR"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unit test requires "command" to be misspelled. It's not a typo.

assert suggested_command == "command"
suggested_command = cu.suggest_similar("command", ["COMMAND", "acommands"])
assert suggested_command == "COMMAND"


def test_similarity_without_good_canididates():
suggested_command = cu.suggest_similar("comand", ["UNRELATED", "NOT_SIMILAR"])
suggested_command = cu.suggest_similar("command", ["UNRELATED", "NOT_SIMILAR"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unit test requires "command" to be misspelled. It's not a typo.

assert suggested_command is None
suggested_command = cu.suggest_similar("comand", [])
suggested_command = cu.suggest_similar("command", [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unit test requires "command" to be misspelled. It's not a typo.

assert suggested_command is None


Expand Down
Loading