Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding missing options to help

  • Loading branch information...
commit a8918bfea9f60779973acd687243d3b1dcc0916b 1 parent 274bfad
@codebox authored
View
56 bmclient/help.txt
@@ -2,48 +2,60 @@ Provides command-line access to the BitMeterOS database
Usage:
bmclient -h|-v|-m<mode> <mode specific options>
-
+
Dump all data using '-md' or '-m dump':
bmclient -m dump [-u <units>] [-f <format>]
-
+
Values allowed for 'units' are:
b - all values displayed in bytes (default)
a - values displayed with abbreviated units
f - values displayed with full units
-
+
Values allowed for 'format' are:
c - CSV format, suitable for import into a spreadsheet
f - fixed width format, easier to read
-
+
Display a database summary using '-ms' or '-m summary':
- bmclient -m summary
-
+ bmclient -m summary [-a <host/adapter>]
+
+ The '-a' option is used to specify that only data for a particular host, or host/adapter combination, should be displayed. To specify that only data from one particular host should be displayed, use the -a option with the name (or alias) of the host as its argument. To specify that only data from one adapter on one host should be displayed, the argument should contain both the host and adapter names separated by a colon. Use the identifier 'local' to refer to the local host. For example:
+ Display a summary of all data for the host 192.168.1.2
+ bmclient -m summary -a 192.168.1.2
+ Display a summary of all data for the adapter eth1 on host 192.168.1.2
+ bmclient -m summary -a 192.168.1.2:eth1
+ Display a summary of all data for the local host
+ bmclient -m summary -a local
+ Display a summary of all data for the adapter eth1 on the local host
+ bmclient -m summary -a local:eth1
+
Monitor current usage using '-mm' or '-m monitor'. This produces a continuously updating display of the current network usage:
- bmclient -m monitor [-t <display type>] [-d <direction>] [-w <max bar width>] [-x <max bar value>]
-
+ bmclient -m monitor [-t <display type>] [-d <direction>] [-w <max bar width>] [-x <max bar value>] [-a <host/adapter>]
+
Values allowed for 'display type' are:
n - numeric, both upload and download values are displayed numerically (default)
b - bar graph, either upload or download values are displayed as bars of varying width (see subsequent arguments)
-
+
The 'direction' argument is ignored unless a display type of 'b' (bar graph) is selected. Permitted values are:
d - download, the length of the bars vary according to the current download speed (default)
u - upload, the length of the bars vary according to the current upload speed
-
+
The 'max bar width' argument is ignored unless a display type of 'b' (bar graph) is selected.
A numeric value must be supplied with this option, to indicate the width (in characters) of the longest bar that will be displayed (default is 69 to allow each line, including the numeric output, to fit on an 80 character display)
-
+
The 'max bar value' argument is ignored unless a display type of 'b' (bar graph) is selected.
A numeric value must be supplied with this option, to indicate the maximum upload/download value (in bytes) that can be displayed before the bar reaches the maximum width specified by the 'max bar width' argument (default value is 100000)
-
+
+ The 'host/adapter' argument is explained above, in the 'summary' section.
+
Query the database using '-mq' or '-m query':
- bmclient -m query -r <range> [-g <grouping>] [-u <units>]
-
+ bmclient -m query -r <range> [-g <grouping>] [-u <units>] [-a <host/adapter>]
+
The 'range' argument specifies the date/time range for which you want to see information. The range can consist of either 1 or 2 date components, if 2 date components are present then they must be separated by a hyphen. Each date component can be in 1 of 4 different formats, shown below:
yyyy - a 4 digit year
yyyymm - a year followed by a 2 digit month
yyyymmdd - a year and month followed by a 2 digit day
yyyymmddhh - a year, month and day, followed by a 2 digit hour
-
+
Some examples:
Show all data recorded during the year 2009:
bmclient -m query -r2009
@@ -53,21 +65,23 @@ Query the database using '-mq' or '-m query':
bmclient -m query -r2002010104
OR
bmclient -m query -r2002010104-2002010105
-
+
The 'grouping' argument specifies if/how the results of the query should be grouped when they are displayed:
t - do not group results, display overall total only (default)
h - group results by hour
d - group results by day
m - group results by month
y - group results by year
-
+
The 'units' argument is explained above, in the 'dump' section.
-
+
+ The 'host/adapter' argument is explained above, in the 'summary' section.
+
Display version information
bmclient -v
-
+
Display this help
bmclient -h
-
+
Email: rob@codebox.org.uk
-Web: http://codebox.org.uk/bitmeterOs
+Web: http://codebox.org.uk/bitmeteros
View
22 bmclient/man.txt
@@ -21,11 +21,21 @@ Values allowed for 'format' are:
.SS View a summary
Display a database summary using '-ms' or '-m summary':
- bmclient -m summary
+ bmclient -m summary [-a <host/adapter>]
+
+The '-a' option is used to specify that only data for a particular host, or host/adapter combination, should be displayed. To specify that only data from one particular host should be displayed, use the -a option with the name (or alias) of the host as its argument. To specify that only data from one adapter on one host should be displayed, the argument should contain both the host and adapter names separated by a colon. Use the identifier 'local' to refer to the local host. For example:
+ Display a summary of all data for the host 192.168.1.2
+ bmclient -m summary -a 192.168.1.2
+ Display a summary of all data for the adapter eth1 on host 192.168.1.2
+ bmclient -m summary -a 192.168.1.2:eth1
+ Display a summary of all data for the local host
+ bmclient -m summary -a local
+ Display a summary of all data for the adapter eth1 on the local host
+ bmclient -m summary -a local:eth1
.SS Monitor current usage
Monitor current usage using '-mm' or '-m monitor'. This produces a continuously updating display of the current network usage:
- bmclient -m monitor [-t <display type>] [-d <direction>] [-w <max bar width>] [-x <max bar value>]
+ bmclient -m monitor [-t <display type>] [-d <direction>] [-w <max bar width>] [-x <max bar value>] [-a <host/adapter>]
Values allowed for 'display type' are:
n - numeric, both upload and download values are displayed numerically (default)
@@ -41,9 +51,11 @@ The 'max bar width' argument is ignored unless a display type of 'b' (bar graph)
The 'max bar value' argument is ignored unless a display type of 'b' (bar graph) is selected.
A numeric value must be supplied with this option, to indicate the maximum upload/download value (in bytes) that can be displayed before the bar reaches the maximum width specified by the 'max bar width' argument (default value is 100000)
+The 'host/adapter' argument is explained above, in the 'summary' section.
+
.SS Query the database
Query the database using '-mq' or '-m query':
- bmclient -m query -r <range> [-g <grouping>] [-u <units>]
+ bmclient -m query -r <range> [-g <grouping>] [-u <units>] [-a <host/adapter>]
The 'range' argument specifies the date/time range for which you want to see information. The range can consist of either 1 or 2 date components, if 2 date components are present then they must be separated by a hyphen. Each date component can be in 1 of 4 different formats, shown below:
yyyy - a 4 digit year
@@ -70,6 +82,8 @@ The 'grouping' argument specifies if/how the results of the query should be grou
The 'units' argument is explained above, in the 'dump' section.
+The 'host/adapter' argument is explained above, in the 'summary' section.
+
.SS Display version
Display version information
bmclient -v
@@ -81,4 +95,4 @@ Display this help
.SH AUTHOR
Email: rob@codebox.org.uk
.br
-Web: http://codebox.org.uk/bitmeterOs
+Web: http://codebox.org.uk/bitmeteros
View
47 bmclient/src/helpText.c
@@ -1,32 +1,6 @@
-/*
- * BitMeterOS
- * http://codebox.org.uk/bitmeterOS
- *
- * Copyright (c) 2011 Rob Dawson
- *
- * Licensed under the GNU General Public License
- * http://www.gnu.org/licenses/gpl.txt
- *
- * This file is part of BitMeterOS.
- *
- * BitMeterOS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * BitMeterOS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with BitMeterOS. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "common.h"
-char* helpTxt=
+#include "common.h"
+char* helpTxt=
"Provides command-line access to the BitMeterOS database" EOL
-" " EOL
"Usage:" EOL
" bmclient -h|-v|-m<mode> <mode specific options>" EOL
" " EOL
@@ -39,8 +13,8 @@ char* helpTxt=
" f - values displayed with full units" EOL
" " EOL
" Values allowed for 'format' are:" EOL
-" c - CSV format, suitable for import into a spreadsheet" EOL
-" f - fixed width format, easier to read" EOL
+" c - CSV format, suitable for import into a spreadsheet" EOL
+" f - fixed width format, easier to read" EOL
" " EOL
"Display a database summary using '-ms' or '-m summary':" EOL
" bmclient -m summary [-a <host/adapter>]" EOL
@@ -72,8 +46,8 @@ char* helpTxt=
" The 'max bar value' argument is ignored unless a display type of 'b' (bar graph) is selected." EOL
" A numeric value must be supplied with this option, to indicate the maximum upload/download value (in bytes) that can be displayed before the bar reaches the maximum width specified by the 'max bar width' argument (default value is 100000)" EOL
" " EOL
-" The 'host/adapter' argument is explained above, in the Summary section." EOL
-" " EOL
+" The 'host/adapter' argument is explained above, in the 'summary' section." EOL
+" " EOL
"Query the database using '-mq' or '-m query':" EOL
" bmclient -m query -r <range> [-g <grouping>] [-u <units>] [-a <host/adapter>]" EOL
" " EOL
@@ -101,8 +75,8 @@ char* helpTxt=
" y - group results by year" EOL
" " EOL
" The 'units' argument is explained above, in the 'dump' section." EOL
-" " EOL
-" The 'host/adapter' argument is explained above, in the Summary section." EOL
+" " EOL
+" The 'host/adapter' argument is explained above, in the 'summary' section." EOL
" " EOL
"Display version information" EOL
" bmclient -v" EOL
@@ -111,6 +85,5 @@ char* helpTxt=
" bmclient -h" EOL
" " EOL
"Email: rob@codebox.org.uk" EOL
-"Web: http://codebox.org.uk/bitmeteros" EOL
-" " EOL
-;
+"Web: http://codebox.org.uk/bitmeterOs" EOL
+;
View
1  bmclient/src/options.c
@@ -298,6 +298,7 @@ static int setRange(struct Prefs *prefs, char* rangeTxt){
prefs->rangeTo = adjustForEndOfRange(tsTo, strlen(rangeTo));
}
}
+
return SUCCESS;
}
Please sign in to comment.
Something went wrong with that request. Please try again.