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

Response to mis-typing command line options is cryptic/mis-leading #80

Closed
tillkamppeter opened this issue Nov 16, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working priority-low
Milestone

Comments

@tillkamppeter
Copy link
Contributor

Describe the bug
You can submit a job via

ps-printer-app -d test -o collate=on file.pdf

and it gets printed. If you mis-type, ommitting a space, you get

ps-printer-app -d test -ocollate=on file.pdf
ps-printer-app: Missing hostname after '-h'.

There is no -h inside, only a missing space.

Even more bizarre (the missing space is at the first-digit option):

ps-printer-app -d test -o collate=on -o print-color-as-gray=on -o rgb-color=photo-s-rgb -o secure-printing=on -ofirst-digit=5 -o second-digit=6 -o third-digit=7 -o fourth-digit=8 ~/ghostscript/testfiles/CityMap.pdf
ps-printer-app: Unknown option '-i'.

Either it should clearly tell that there is a space missing and where, or it should behave like CUPS' lp where you can supply the options with or without space after the -o.

To Reproduce
Simply print with supplying options via -o and omit the space before the option name.

@michaelrsweet michaelrsweet self-assigned this Nov 16, 2020
@michaelrsweet michaelrsweet added bug Something isn't working priority-low labels Nov 16, 2020
@michaelrsweet michaelrsweet added this to the v1.0 milestone Nov 16, 2020
@michaelrsweet
Copy link
Owner

@tillkamppeter The CUPS "lp" behavior is there for backwards-compatibility with the System V printing system which doesn't follow the modern option processing behavior.

Certainly we should not report the wrong error message, and I might be inclined to protect against "-ofoo=bar", but I also don't want to continue the "no space is OK" policy that CUPS was forced to support.

@michaelrsweet
Copy link
Owner

[master 9db4470] Show error if an option appears after -o without a space (Issue #80)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low
Projects
None yet
Development

No branches or pull requests

2 participants