Comments (4)
Maybe all that can be done is to document the --
After giving it some thought, trying to do what coreutils echo and some others do (echo "-n-"
works and echo "-n"
does not) is a little inconsistent so documenting really may be best.
from libqrencode.
On many systems' command line input, -x
and --xyz
, whether or not within single or double quotes, will be interpreted as command line options. --test
is no different from "--test"
, it will see --
and try to treat it as an option. If you put the text within quotation marks (double quotes), you can often escape the string and tell the command line or script interpreter not to use it as a command line option: "\--test"
. Inconvenient, but a possible workaround.
from libqrencode.
If you put the text within quotation marks (double quotes), you can often escape the string and tell the command line or script interpreter not to use it as a command line option:
"\--test"
.
@PhilterPaper That’s not how it works either – the program will just see the string \--test
with a literal backslash (since \-
isn’t a meaningful double-quoted escape sequence) and produce the wrong output.
The --
end-of-options marker is the correct solution, and is a well-established standard.
from libqrencode.
That's why I added the caveat often when talking about command line strings with a leading "-". It's going to be handled by the application, not by the OS, and it may or may not see the "escape". As an example of where this does work, see "grep" (at least, the Windows implementation). grep -S "--test--" filepattern
will complain about an illegal option, but grep -S "\--test--" filepattern
works correctly. It's something the OP might give a try just to see if it works for them.
A formal end-of-options marker, if implemented, would be the proper way to do it (and is not a "workaround").
from libqrencode.
Related Issues (20)
- rMQR Support
- ANSI and UTF8 types do not display properly on Windows HOT 2
- Please mention SVG output option in usage summary
- [Build Failed] Please consider updating autotool scripts.
- The library doesn't respect the encoding standard HOT 1
- Generation of lib and dll for windows
- Optimal text segmentation HOT 1
- Generate a QR code image with logo HOT 5
- Detect type of image from extension
- Setting --dpi has no effect on the PNG output HOT 2
- qrencode does not work with local linux vt/console
- Is it possible to use QRcode_encodeData() with command line tool (qrencode)?
- How to add qrencode libraries in Qt creator?
- Cmake error HOT 1
- libqrencode on Perl and on Windows
- Questionable interpretation of mask scoring criterion number 3 (finder pattern) HOT 2
- IS THIS PROJECT DEAD?
- What is the maximum string length for QRcode_encodeStringStructured? HOT 1
- Wrong constant in QRinput_encodeModeECI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libqrencode.