Skip to content
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

docs: Some typos in cli/cli_library.rst #8941

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
20 changes: 10 additions & 10 deletions user_guide_src/source/cli/cli_library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ CLI Library
CodeIgniter's CLI library makes creating interactive command-line scripts simple, including:

* Prompting the user for more information
* Writing multi-colored text the terminal
* Writing multi-colored text in the terminal
* Beeping (be nice!)
* Showing progress bars during long tasks
* Wrapping long text lines to fit the window.
* Wrapping long text lines to fit the window
paulbalandan marked this conversation as resolved.
Show resolved Hide resolved

.. contents::
:local:
Expand Down Expand Up @@ -79,7 +79,7 @@ promptByMultipleKeys()

.. versionadded:: 4.3.0

This method is the same as ``promptByKey()``, but it supports multiple value.
This method is the same as ``promptByKey()``, but it supports multiple values.

.. literalinclude:: cli_library/023.php

Expand All @@ -91,7 +91,7 @@ Providing Feedback
write()
=======

Several methods are provided for you to provide feedback to your users. This can be as simple as a single status update
There are several methods for you to provide feedback to your users. This can be as simple as a single status update
or a complex table of information that wraps to the user's terminal window. At the core of this is the ``write()``
method which takes the string to output as the first parameter:

Expand Down Expand Up @@ -140,9 +140,9 @@ And a smaller number are available as background colors:
print()
=======

Print functions identically to the ``write()`` method, except that it does not force a newline either before or after.
Instead it prints it to the screen wherever the cursor is currently. This allows you to print multiple items all on
the same line, from different calls. This is especially helpful when you want to show a status, do something, then
print() functions identically to the ``write()`` method, except that it does not force a newline either before or after.
Instead it prints output to the screen wherever the cursor currently is. This allows you to print multiple items
from different calls all on the same line. This is especially helpful when you want to show a status, do something, then
print "Done" on the same line:

.. literalinclude:: cli_library/012.php
Expand All @@ -152,7 +152,7 @@ print "Done" on the same line:
color()
=======

While the ``write()`` command will write a single line to the terminal, ending it with a EOL character, you can
While the ``write()`` command will write a single line to the terminal, ending it with an EOL character, you can
use the ``color()`` method to make a string fragment that can be used in the same way, except that it will not force
an EOL after printing. This allows you to create multiple outputs on the same row. Or, more commonly, you can use
it inside of a ``write()`` method to create a string of a different color inside:
Expand All @@ -166,7 +166,7 @@ error()
=======

If you need to output errors, you should use the appropriately named ``error()`` method. This writes light-red text
to STDERR, instead of STDOUT, like ``write()`` and ``color()`` do. This can be useful if you have scripts watching
to STDERR, instead of STDOUT like ``write()`` and ``color()`` do. This can be useful if you have scripts watching
for errors so they don't have to sift through all of the information, only the actual error messages. You use it
exactly as you would the ``write()`` method:

Expand Down Expand Up @@ -203,7 +203,7 @@ Would create something like this:
text of the printing and
typesetting industry.
task1abc Lorem Ipsum has been the
industry's standard dummy
industry standard dummy
Copy link
Member

Choose a reason for hiding this comment

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

The apostrophe here is correct.

Copy link
Member

Choose a reason for hiding this comment

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

ChatGPT said "industry standard" is correct.

The following is an answer by Claude 3 Sonnet.
Is this explanation correct?


Both "industry's standard" and "industry standard" are grammatically correct in English, but they have slightly different meanings and usages.

  1. "Industry standard" (without an apostrophe)
    This term refers to a standard, practice, or specification that is widely accepted and used within a particular industry. It is the norm or generally accepted way of doing something in that industry. For example:
  • USB is an industry standard for connecting peripheral devices to computers.
  • PDF has become an industry standard for sharing documents across different platforms.
  1. "Industry's standard" (with an apostrophe)
    This phrase refers to the specific standard or norm that is used or accepted by a particular industry. It is more explicit in indicating that the standard belongs to or is associated with a specific industry. For example:
  • The construction industry's standard for safety equipment has become more stringent.
  • The automotive industry's standard for fuel efficiency has been revised.

In most cases, "industry standard" without the apostrophe is more common and idiomatic when referring to a widely accepted norm or practice within an industry. However, "industry's standard" can be used when you want to emphasize that the standard is specific to a particular industry or clarify which industry you are referring to.

Copy link
Member

Choose a reason for hiding this comment

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

From https://www.lipsum.com/

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s [...]

In this case we can rewrite the 2nd sentence as "Lorem ipsum has been the standard dummy text of the [printing and typesetting] industry ever since the 1500s [...]"

Another way to look at it is this: industry standard is a noun; if we mean it that way, we cannot use it as an adjective for "dummy text"

Copy link
Member

@kenjis kenjis Jun 13, 2024

Choose a reason for hiding this comment

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

@paulbalandan Thank you. I got it.

I fixed the question, but ChatGPT still says "industry standard" is correct. It seems s/he likes the phrase. https://chatgpt.com/share/0c469d88-dc36-40ed-9ab9-b8c179db89b0

Gemini says "industry's standard" is grammatically correct.

text ever since the

newLine()
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/cli/cli_library/017.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
];
$descriptions = [
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
"Lorem Ipsum has been the industry's standard dummy text ever since the",
'Lorem Ipsum has been the industry standard dummy text ever since the',
Copy link
Member

Choose a reason for hiding this comment

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

The apostrophe is correct here.

];

// Determine the maximum length of all titles
Expand Down