All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Babioch <karol@babioch.de>
To: linux-bluetooth@vger.kernel.org
Subject: tools: Parsing commands is lenient?
Date: Tue, 03 Dec 2013 22:27:07 +0100	[thread overview]
Message-ID: <529E4CAB.6010703@babioch.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

Hi,

I've stumbled across something, which is probably a feature, but I
couldn't find it documented anywhere, so I'm going to bring it up anyway.

The parsing of the "command" field for (at least) the tools "hcitool"
and "sdptool" is quite inaccurate. For example when I want to scan for
Bluetooth devices, I would use something like:

[johnpatcher@vpcs ~]$ hcitool scan
Scanning ...

This works great, but so does the following, too:

[johnpatcher@vpcs ~]$ hcitool scan123
Scanning ...

So, it seems that basically you can append whatever you want to a
command, as long as the command itself is valid.

First of all, I'm not sure whether it is actually a good idea to be
lenient when it comes down to parsing a command. I guess most of you are
around *nix systems even longer than me, but at least I'm used to some
sort of an error message as soon as I goof up a command on the console.
At least, theoretically speaking, one could come up with some scenarios,
where this could go terribly wrong when some commands are added and/or
changed.

Secondly, I think that this sort of behavior should actually be
documented when this is and/or was an explicit consideration, for
instance within the man page(s) of the appropriate tools.

Maybe I'm making too much of a fuss about this, but at least I was
*really* surprised by this. I just want to make sure that this isn't
something that was overlooked and/or introduced by a stupid
carelessness, but rather was a conscious decision.

Best regards,
Karol Babioch


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

                 reply	other threads:[~2013-12-03 21:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529E4CAB.6010703@babioch.de \
    --to=karol@babioch.de \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.