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

echo: remove non-standard -? #417

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Jan 25, 2024

  • Sometimes echo is built into the shell
  • Standards document for echo doesn't mention the -? flag [1]
  • The versions of echo that I tested don't support it
  • I think it's better to follow convention and not treat -? as an option
  • Sync pod and fix a typo in DESCRIPTION
  1. https://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html
# bash builtin
% builtin echo $BASH_VERSION
5.1.4(1)-release
% builtin echo -?
-?
% builtin echo --version
--version

# gnu echo
% /bin/echo -?
-?
% /bin/echo --version
echo (GNU coreutils) 8.32

# pdksh builtin
% builtin echo -?
-?
% builtin echo --version
--version
% builtin echo $KSH_VERSION
@(#)PD KSH v5.2.14 99/07/13.2

# openbsd echo
% /bin/echo -?
-?
% /bin/echo --version
--version

* Sometimes echo is built into the shell
* Standards document for echo doesn't mention the -? flag [1]
* Versions of echo that I tested don't support it
* I think it's better to follow convention
* Sync pod and fix a typo in DESCRIPTION

1. https://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html

# bash builtin
% builtin echo $BASH_VERSION
5.1.4(1)-release
% builtin echo -?
-?
% builtin echo --version
--version

# gnu echo
% /bin/echo -?
-?
% /bin/echo --version
echo (GNU coreutils) 8.32

# pdksh builtin
% builtin echo -?
-?
% builtin echo --version
--version
% builtin echo $KSH_VERSION
@(#)PD KSH v5.2.14 99/07/13.2

# openbsd echo
% /bin/echo -?
-?
% /bin/echo --version
--version
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: echo The echo program labels Jan 25, 2024
@briandfoy briandfoy self-assigned this Jan 25, 2024
Copy link
Owner

@briandfoy briandfoy left a comment

Choose a reason for hiding this comment

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

In general, I think your changes to let -? be handled as an unknown option and trigger usage is a good way to go.

@briandfoy briandfoy merged commit 1edbc9c into briandfoy:master Jan 25, 2024
1 of 2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Jan 25, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: echo The echo program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants