Browse Source

Unify and shorten the usage messages. The details can be found in

the man pages so no need to be verbose.


git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5201 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.2
Jean Delvare 18 years ago
parent
commit
2c57ef91a2
  1. 4
      CHANGES
  2. 17
      tools/i2cdetect.c
  3. 14
      tools/i2cdump.c
  4. 19
      tools/i2cget.c
  5. 14
      tools/i2cset.c

4
CHANGES

@ -4,9 +4,13 @@ i2c-tools CHANGES
SVN
decode-vaio: Remove history
i2cdetect: Support i2c bus passed by name
Shorten the usage message
i2cdump: Support i2c bus passed by name
Shorten the usage message
i2cget: Support i2c bus passed by name
Shorten the usage message
i2cset: Support i2c bus passed by name
Shorten the usage message
3.0.1 (2008-04-04)
Drop the trailing .pl from all perl script names

17
tools/i2cdetect.c

@ -37,18 +37,11 @@
static void help(void)
{
fprintf(stderr,
"Syntax: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\n"
" i2cdetect -F I2CBUS\n"
" i2cdetect -l\n"
" i2cdetect -V\n"
" I2CBUS is an integer\n"
" With -a, probe all addresses (NOT RECOMMENDED)\n"
" With -q, uses only quick write commands for probing (NOT "
"RECOMMENDED)\n"
" With -r, uses only read byte commands for probing (NOT "
"RECOMMENDED)\n"
" If provided, FIRST and LAST limit the probing range.\n"
" With -l, lists installed busses only\n");
"Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\n"
" i2cdetect -F I2CBUS\n"
" i2cdetect -l\n"
" I2CBUS is an integer or an I2C bus name\n"
" If provided, FIRST and LAST limit the probing range.\n");
}
static int scan_i2c_bus(int file, int mode, int first, int last)

14
tools/i2cdump.c

@ -32,9 +32,10 @@
static void help(void)
{
fprintf(stderr, "Syntax: i2cdump [-f] [-r first-last] [-y] I2CBUS "
"ADDRESS [MODE] [BANK [BANKREG]]\n"
" i2cdump -V\n"
fprintf(stderr,
"Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE] [BANK [BANKREG]]\n"
" I2CBUS is an integer or an I2C bus name\n"
" ADDRESS is an integer (0x00 - 0x7f)\n"
" MODE is one of:\n"
" b (byte, default)\n"
" w (word)\n"
@ -42,12 +43,7 @@ static void help(void)
" s (SMBus block)\n"
" i (I2C block)\n"
" c (consecutive byte)\n"
" Append 'p' to 'b', 'w', 's' or 'c' for PEC checking\n"
" I2CBUS is an integer\n"
" ADDRESS is an integer 0x00 - 0x7f\n"
" BANK and BANKREG are for byte and word accesses (default "
"bank 0, reg 0x4e)\n"
" BANK is the command for smbusblock accesses (default 0)\n");
" Append p for SMBus PEC\n");
}
int main(int argc, char *argv[])

19
tools/i2cget.c

@ -37,16 +37,15 @@ static void help(void) __attribute__ ((noreturn));
static void help(void)
{
fprintf(stderr, "Syntax: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS "
"[DATA-ADDRESS [MODE]]\n"
" i2cget -V\n"
" MODE can be: 'b' (read byte data, default)\n"
" 'w' (read word data)\n"
" 'c' (write byte/read byte)\n"
" If DATA-ADDRESS is omitted, a single read byte command is "
"issued\n"
" Append 'p' to MODE for PEC checking\n"
" I2CBUS is an integer\n");
fprintf(stderr,
"Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\n"
" I2CBUS is an integer or an I2C bus name\n"
" ADDRESS is an integer (0x03 - 0x77)\n"
" MODE is one of:\n"
" b (read byte data, default)\n"
" w (read word data)\n"
" c (write byte/read byte)\n"
" Append p for SMBus PEC\n");
exit(1);
}

14
tools/i2cset.c

@ -34,12 +34,14 @@ static void help(void) __attribute__ ((noreturn));
static void help(void)
{
fprintf(stderr, "Syntax: i2cset [-f] [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS "
"VALUE [MODE] [MASK]\n"
" i2cset -V\n"
" MODE is 'b[yte]' or 'w[ord]' (default b)\n"
" Append 'p' to MODE for PEC checking\n"
" I2CBUS is an integer\n");
fprintf(stderr,
"Usage: i2cset [-f] [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS VALUE [MODE] [MASK]\n"
" I2CBUS is an integer or an I2C bus name\n"
" ADDRESS is an integer (0x00 - 0x7f)\n"
" MODE is one of:\n"
" b (byte, default)\n"
" w (word)\n"
" Append p for SMBus PEC\n");
exit(1);
}

Loading…
Cancel
Save