accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1244721 - in /incubator/accumulo/trunk: ./ docs/src/user_manual/appendices/ src/core/ src/core/src/main/java/org/apache/accumulo/core/util/shell/ src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ src/server/
Date Wed, 15 Feb 2012 21:02:15 GMT
Author: billie
Date: Wed Feb 15 21:02:14 2012
New Revision: 1244721

URL: http://svn.apache.org/viewvc?rev=1244721&view=rev
Log:
ACCUMULO-333 added wrapping for shell command - merged to trunk

Removed:
    incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_command.sh
Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_commands.sh
    incubator/accumulo/trunk/docs/src/user_manual/appendices/shell_commands.tex
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteRowsCommand.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java
    incubator/accumulo/trunk/src/server/   (props changed)

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 15 21:02:14 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1242521
+/incubator/accumulo/branches/1.4:1201902-1242521,1244690-1244693

Modified: incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_commands.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_commands.sh?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_commands.sh (original)
+++ incubator/accumulo/trunk/docs/src/user_manual/appendices/get_shell_commands.sh Wed Feb
15 21:02:14 2012
@@ -35,12 +35,7 @@ echo "% Licensed to the Apache Software 
 echo "\\chapter{Shell Commands}"
 echo
 echo "\\begin{alltt}"
-echo "help -np
-quit" | \
-../../../../bin/accumulo shell -u foo -p foo --fake | \
-#head -11 | \
-gawk 'BEGIN{count = 0}{if(count > 9 && substr($0,0,4) != "foo@"){print "\\textbf{"$1"}\n";
system("./get_shell_command.sh \""$1"\""); print "";};count += 1}' |\
-sed -e 's/_/\\_/g'
+../../../../bin/accumulo shell -u foo -p foo --fake -e "help -nw `../../../../bin/accumulo
shell -u foo -p foo --fake -e "help -np -nw" | cut -d" " -f1 | perl -ne 'chomp; print; print
" "'`" 2>&1 | perl -ne '$l = $_; if (/^usage: ([^ ]+)/) {print "\n\\textbf{$1}\n\n"}
$l =~ s/\t/  /g; $l =~ s/  +/  /g; use Text::Wrap; $Text::Wrap::columns=89; $Text::Wrap::break="[
]"; $Text::Wrap::unexpand=0; print wrap("    ","              ",$l);'
 echo
 echo "\\end{alltt}"
 

Modified: incubator/accumulo/trunk/docs/src/user_manual/appendices/shell_commands.tex
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/src/user_manual/appendices/shell_commands.tex?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/src/user_manual/appendices/shell_commands.tex (original)
+++ incubator/accumulo/trunk/docs/src/user_manual/appendices/shell_commands.tex Wed Feb 15
21:02:14 2012
@@ -16,29 +16,30 @@
 \chapter{Shell Commands}
 
 \begin{alltt}
+
 \textbf{?}
 
-    usage: ? [ <command>{ <command>} ] [-?] [-np]
+    usage: ? [ <command>{ <command>} ] [-?] [-np] [-nw]
     description: provides information about the available commands
       -?,--help  display this help
       -np,--no-pagination  disables pagination of output
+      -nw,--no-wrap  disables wrapping of output
 
 \textbf{about}
 
     usage: about [-?] [-v]
     description: displays information about this program
       -?,--help  display this help
-      -v,--verbose	displays details session information
+      -v,--verbose  displays details session information
 
 \textbf{addsplits}
 
-    usage: addsplits [<split>{ <split>} ] [-?] [-b64] [-sf <filename>]
[-t
-    	      <tableName>]
+    usage: addsplits [<split>{ <split>} ] [-?] [-b64] [-sf <filename>]
[-t <tableName>]
     description: add split points to an existing table
       -?,--help  display this help
-      -b64,--base64encoded	decode encoded split points
-      -sf,--splits-file <filename>	file with newline separated list of rows to add
-    	      to table
+      -b64,--base64encoded  decode encoded split points
+      -sf,--splits-file <filename>  file with newline separated list of rows to add
to
+              table
       -t,--table <tableName>  name of a table to add split points to
 
 \textbf{authenticate}
@@ -68,14 +69,14 @@
 \textbf{clonetable}
 
     usage: clonetable <current table name> <new table name> [-?] [-e <arg>]
[-nf] [-s
-    	      <arg>]
+              <arg>]
     description: clone a table
       -?,--help  display this help
       -e,--exclude <arg>  properties that should not be copied from source table.
-    	      Expects <prop>{,<prop>}
+              Expects <prop>{,<prop>}
       -nf,--noFlush  do not flush table data in memory before cloning.
       -s,--set <arg>  set initial properties before the table comes online. Expects
-    	      <prop>=<value>{,<prop>=<value>}
+              <prop>=<value>{,<prop>=<value>}
 
 \textbf{cls}
 
@@ -86,11 +87,11 @@
 \textbf{compact}
 
     usage: compact [-?] [-b <arg>] [-e <arg>] [-nf] [-p <pattern> | -t
<tableName>] 
-    	      [-w]
+              [-w]
     description: sets all tablets for a table to major compact as soon as possible
-    	      (based on current time)
+              (based on current time)
       -?,--help  display this help
-      -b,--begin-row <arg>	begin row
+      -b,--begin-row <arg>  begin row
       -e,--end-row <arg>  end row
       -nf,--noFlush  do not flush table data in memory before compacting.
       -p,--pattern <pattern>  regex pattern of table names to flush
@@ -99,12 +100,12 @@
 
 \textbf{config}
 
-    usage: config [-?] [-d <property> | -f <string> | -s <property=value>]
[-np] 
-    	      [-t <table>]
+    usage: config [-?] [-d <property> | -f <string> | -s <property=value>]
 [-np]  [-t
+              <table>]
     description: prints system properties and table specific properties
       -?,--help  display this help
       -d,--delete <property>  delete a per-table property
-      -f,--filter <string>	show only properties that contain this string
+      -f,--filter <string>  show only properties that contain this string
       -np,--no-pagination  disables pagination of output
       -s,--set <property=value>  set a per-table property
       -t,--table <table>  display/set/delete properties for specified table
@@ -112,24 +113,23 @@
 \textbf{createtable}
 
     usage: createtable <tableName> [-?] [-a
-    	      <{<columnfamily>[:<columnqualifier>]=<aggregation\_class>}>]
[-b64]
-    	      [-cc <table>] [-cs <table> | -sf <filename>] [-evc] [-ndi] 
[-tl |
-    	      -tm]
-    description: creates a new table, with optional aggregators and optionally
-    	      pre-split
-      -?,--help  display this help
-      -a,--aggregator <{<columnfamily>[:<columnqualifier>]=<aggregation\_class>}>

-    	      comma separated column=aggregator
-      -b64,--base64encoded	decode encoded split points
+              <{<columnfamily>[:<columnqualifier>]=<aggregation class>}>]
[-b64] [-cc
+              <table>] [-cs <table> | -sf <filename>] [-evc] [-f <className>]
[-ndi] 
+              [-tl | -tm]
+    description: creates a new table, with optional aggregators and optionally pre-split
+      -?,--help  display this help
+      -a,--aggregator <{<columnfamily>[:<columnqualifier>]=<aggregation
class>}>  comma
+              separated column=aggregator
+      -b64,--base64encoded  decode encoded split points
       -cc,--copy-config <table>  table to copy configuration from
       -cs,--copy-splits <table>  table to copy current splits from
-      -evc,--enable-visibility-constraint  prevents users from writing data they can
-    	      not read.  When enabling this may want to consider disabling bulk
-    	      import and alter table
-      -ndi,--no-default-iterators  prevents creation of the normal default iterator
-    	      set
-      -sf,--splits-file <filename>	file with newline separated list of rows to
-    	      create a pre-split table
+      -evc,--enable-visibility-constraint  prevents users from writing data they can not
+              read.  When enabling this may want to consider disabling bulk import and
+              alter table
+      -f,--formatter <className>  default formatter to set
+      -ndi,--no-default-iterators  prevents creation of the normal default iterator set
+      -sf,--splits-file <filename>  file with newline separated list of rows to create
a
+              pre-split table
       -tl,--time-logical  use logical time
       -tm,--time-millis  use time in milliseconds
 
@@ -149,7 +149,7 @@
 \textbf{delete}
 
     usage: delete <row> <colfamily> <colqualifier> [-?] [-l <expression>]
[-t
-    	      <timestamp>]
+              <timestamp>]
     description: deletes a record from a table
       -?,--help  display this help
       -l,--authorization-label <expression>  formatted authorization label expression
@@ -162,50 +162,51 @@
       -?,--help  display this help
       -majc,--major-compaction  applied at major compaction
       -minc,--minor-compaction  applied at minor compaction
-      -n,--name <itername>	iterator to delete
+      -n,--name <itername>  iterator to delete
       -scan,--scan-time  applied at scan time
       -t,--table <table>  tableName
 
 \textbf{deletemany}
 
     usage: deletemany [-?] [-b <start-row>] [-c
-    	      <{<columnfamily>[:<columnqualifier>]}>] [-e <end-row>]
[-f] [-np]
-    	      [-s <comma-separated-authorizations>] [-st] [-t <table>]
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>]
+              [-e <end-row>] [-f] [-fm <className>] [-np] [-r <row>] [-s
+              <comma-separated-authorizations>] [-st] [-t <table>]
     description: scans a table and deletes the resulting records
       -?,--help  display this help
       -b,--begin-row <start-row>  begin row (inclusive)
-      -c,--columns <{<columnfamily>[:<columnqualifier>]}>  comma-separated
columns
+      -c,--columns
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>

+              comma-separated columns
       -e,--end-row <end-row>  end row (inclusive)
       -f,--force  forces deletion without prompting
+      -fm,--formatter <className>  fully qualified name of the formatter class to use
       -np,--no-pagination  disables pagination of output
+      -r,--row <row>  row to scan
       -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-    	      (all user auths are used if this argument is not specified)
+              (all user auths are used if this argument is not specified)
       -st,--show-timestamps  enables displaying timestamps
       -t,--table <table>  table to be created
 
 \textbf{deleterows}
 
     usage: deleterows [-?] [-b <arg>] [-e <arg>] [-f] [-t <table>]
-    description: delete a range of rows in a table
-    Note that rows matching the start row ARE NOT deleted, but rows matching the end
-    	      row ARE deleted.
+    description: delete a range of rows in a table.  Note that rows matching the start
+              row ARE NOT deleted, but rows matching the end row ARE deleted.
       -?,--help  display this help
-      -b,--begin-row <arg>	begin row
+      -b,--begin-row <arg>  begin row
       -e,--end-row <arg>  end row
       -f,--force  delete data even if start or end are not specified
       -t,--tableName <table>  table to delete row range
 
-\textbf{Note}
-
-
 \textbf{deletescaniter}
 
     usage: deletescaniter [-?] [-a] [-n <itername>] [-t <table>]
-    description: deletes a table-specific scan iterator so it is no longer used
-    	      during this shell session
+    description: deletes a table-specific scan iterator so it is no longer used during
+              this shell session
       -?,--help  display this help
       -a,--all  delete all for tableName
-      -n,--name <itername>	iterator to delete
+      -n,--name <itername>  iterator to delete
       -t,--table <table>  tableName
 
 \textbf{deletetable}
@@ -213,7 +214,7 @@
     usage: deletetable <tableName> [-?] [-t <arg>]
     description: deletes a table
       -?,--help  display this help
-      -t,--tableName <arg>	deletes a table
+      -t,--tableName <arg>  deletes a table
 
 \textbf{deleteuser}
 
@@ -226,7 +227,7 @@
     usage: droptable <tableName> [-?] [-t <arg>]
     description: deletes a table
       -?,--help  display this help
-      -t,--tableName <arg>	deletes a table
+      -t,--tableName <arg>  deletes a table
 
 \textbf{dropuser}
 
@@ -238,30 +239,33 @@
 
     usage: du <table>{ <table>} [-?] [-p <pattern>]
     description: Prints how much space is used by files referenced by a table.  When
-    	      multiple tables are specified it prints how much space is used by
-    	      files shared between tables, if any.
+              multiple tables are specified it prints how much space is used by files
+              shared between tables, if any.
       -?,--help  display this help
       -p,--pattern <pattern>  regex pattern of table names
 
 \textbf{egrep}
 
     usage: egrep <regex>{ <regex>} [-?] [-b <start-row>] [-c
-    	      <{<columnfamily>[:<columnqualifier>]}>] [-e <end-row>]
[-f <int>]
-    	      [-np] [-nt <arg>] [-s <comma-separated-authorizations>] [-st] [-t
-    	      <table>]
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>]
+              [-e <end-row>] [-f <int>] [-fm <className>] [-np] [-nt <arg>]
[-r <row>]
+              [-s <comma-separated-authorizations>] [-st] [-t <table>]
     description: searches each row, column family, column qualifier and value, in
-    	      parallel, on the server side (using a java Matcher, so put .*
-    	      before and after your term if you're not matching the whole
-    	      element)
+              parallel, on the server side (using a java Matcher, so put .* before and
+              after your term if you're not matching the whole element)
       -?,--help  display this help
       -b,--begin-row <start-row>  begin row (inclusive)
-      -c,--columns <{<columnfamily>[:<columnqualifier>]}>  comma-separated
columns
+      -c,--columns
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>

+              comma-separated columns
       -e,--end-row <end-row>  end row (inclusive)
       -f,--show few <int>  Only shows certain amount of characters
+      -fm,--formatter <className>  fully qualified name of the formatter class to use
       -np,--no-pagination  disables pagination of output
       -nt,--num-threads <arg>  num threads
+      -r,--row <row>  row to scan
       -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-    	      (all user auths are used if this argument is not specified)
+              (all user auths are used if this argument is not specified)
       -st,--show-timestamps  enables displaying timestamps
       -t,--tableName <table>  table to grep through
 
@@ -270,7 +274,7 @@
     usage: execfile [-?] [-v]
     description: specifies a file containing accumulo commands to execute
       -?,--help  display this help
-      -v,--verbose	displays command prompt as commands are executed
+      -v,--verbose  displays command prompt as commands are executed
 
 \textbf{exit}
 
@@ -283,7 +287,7 @@
     usage: flush [-?] [-b <arg>] [-e <arg>] [-p <pattern> | -t <tableName>]
 [-w]
     description: flushes a tables data that is currently in memory to disk
       -?,--help  display this help
-      -b,--begin-row <arg>	begin row
+      -b,--begin-row <arg>  begin row
       -e,--end-row <arg>  end row
       -p,--pattern <pattern>  regex pattern of table names to flush
       -t,--table <tableName>  name of a table to flush
@@ -291,12 +295,13 @@
 
 \textbf{formatter}
 
-    usage: formatter [-?] -f <className> | -l | -r
-    description: specifies a formatter to use for displaying database entries
+    usage: formatter [-?] -f <className> | -l | -r  [-t <table>]
+    description: specifies a formatter to use for displaying table entries
       -?,--help  display this help
-      -f,--formatter <className>  fully qualified name of formatter class to use
+      -f,--formatter <className>  fully qualified name of the formatter class to use
       -l,--list  display the current formatter
-      -r,--reset  reset to default formatter
+      -r,--remove  remove the current formatter
+      -t,--table <table>  table to set the formatter on
 
 \textbf{getauths}
 
@@ -317,11 +322,11 @@
     usage: getsplits [-?] [-b64] [-m <num>] [-o <file>] [-t <table>] [-v]
     description: retrieves the current split points for tablets in the current table
       -?,--help  display this help
-      -b64,--base64encoded	encode the split points
+      -b64,--base64encoded  encode the split points
       -m,--max <num>  specifies the maximum number of splits to create
       -o,--output <file>  specifies a local file to write the splits to
       -t,--tableName <table>  table to get splits on
-      -v,--verbose	print out the tablet information with start/end rows
+      -v,--verbose  print out the tablet information with start/end rows
 
 \textbf{grant}
 
@@ -331,35 +336,40 @@
       -p,--pattern <pattern>  regex pattern of tables to grant permissions on
       -s,--system  grant a system permission
       -t,--table <table>  grant a table permission on this table
-      -u,--user <username>	user to operate on
+      -u,--user <username>  user to operate on
 
 \textbf{grep}
 
     usage: grep <term>{ <term>} [-?] [-b <start-row>] [-c
-    	      <{<columnfamily>[:<columnqualifier>]}>] [-e <end-row>]
[-f <int>]
-    	      [-np] [-nt <arg>] [-s <comma-separated-authorizations>] [-st] [-t
-    	      <table>]
-    description: searches each row, column family, column qualifier and value in a
-    	      table for a substring (not a regular expression), in parallel, on
-    	      the server side
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>]
+              [-e <end-row>] [-f <int>] [-fm <className>] [-np] [-nt <arg>]
[-r <row>]
+              [-s <comma-separated-authorizations>] [-st] [-t <table>]
+    description: searches each row, column family, column qualifier and value in a table
+              for a substring (not a regular expression), in parallel, on the server
+              side
       -?,--help  display this help
       -b,--begin-row <start-row>  begin row (inclusive)
-      -c,--columns <{<columnfamily>[:<columnqualifier>]}>  comma-separated
columns
+      -c,--columns
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>

+              comma-separated columns
       -e,--end-row <end-row>  end row (inclusive)
       -f,--show few <int>  Only shows certain amount of characters
+      -fm,--formatter <className>  fully qualified name of the formatter class to use
       -np,--no-pagination  disables pagination of output
       -nt,--num-threads <arg>  num threads
+      -r,--row <row>  row to scan
       -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-    	      (all user auths are used if this argument is not specified)
+              (all user auths are used if this argument is not specified)
       -st,--show-timestamps  enables displaying timestamps
       -t,--tableName <table>  table to grep through
 
 \textbf{help}
 
-    usage: help [ <command>{ <command>} ] [-?] [-np]
+    usage: help [ <command>{ <command>} ] [-?] [-np] [-nw]
     description: provides information about the available commands
       -?,--help  display this help
       -np,--no-pagination  disables pagination of output
+      -nw,--no-wrap  disables wrapping of output
 
 \textbf{history}
 
@@ -371,8 +381,8 @@
 \textbf{importdirectory}
 
     usage: importdirectory <directory> <failureDirectory> true|false [-?]
-    description: bulk imports an entire directory of data files to the current table.
-    	       The boolean argument determines if accumulo sets the time.
+    description: bulk imports an entire directory of data files to the current table. 
+              The boolean argument determines if accumulo sets the time.
       -?,--help  display this help
 
 \textbf{info}
@@ -380,37 +390,48 @@
     usage: info [-?] [-v]
     description: displays information about this program
       -?,--help  display this help
-      -v,--verbose	displays details session information
+      -v,--verbose  displays details session information
 
 \textbf{insert}
 
     usage: insert <row> <colfamily> <colqualifier> <value> [-?] [-l
<expression>] [-t
-    	      <timestamp>]
+              <timestamp>]
     description: inserts a record
       -?,--help  display this help
       -l,--authorization-label <expression>  formatted authorization label expression
       -t,--timestamp <timestamp>  timestamp to use for insert
 
+\textbf{listiter}
+
+    usage: listiter [-?] [-majc] [-minc] [-n <itername>] [-scan] [-t <table>]
+    description: lists table-specific iterators
+      -?,--help  display this help
+      -majc,--major-compaction  applied at major compaction
+      -minc,--minor-compaction  applied at minor compaction
+      -n,--name <itername>  iterator to delete
+      -scan,--scan-time  applied at scan time
+      -t,--table <table>  tableName
+
 \textbf{listscans}
 
     usage: listscans [-?] [-np] [-ts <tablet server>]
     description: list what scans are currently running in accumulo. See the
-    	      accumulo.core.client.admin.ActiveScan javadoc for more information
-    	      about columns.
+              accumulo.core.client.admin.ActiveScan javadoc for more information about
+              columns.
       -?,--help  display this help
       -np,--no-pagination  disables pagination of output
       -ts,--tabletServer <tablet server>  list scans for a specific tablet server
 
 \textbf{masterstate}
 
-    usage: use the command line utility instead [-?]
+    usage: masterstate is deprecated, use the command line utility instead [-?]
     description: DEPRECATED: use the command line utility instead
       -?,--help  display this help
 
 \textbf{maxrow}
 
     usage: maxrow [-?] [-b <begin-row>] [-be] [-e <end-row>] [-ee] [-s
-    	      <comma-separated-authorizations>] [-t <table>]
+              <comma-separated-authorizations>] [-t <table>]
     description: find the max row in a table within a given range
       -?,--help  display this help
       -b,--begin-row <begin-row>  begin row
@@ -418,7 +439,7 @@
       -e,--end-row <end-row>  end row
       -ee,--end-exclusive  make end row exclusive, by defaults it inclusive
       -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-    	      (all user auths are used if this argument is not specified)
+              (all user auths are used if this argument is not specified)
       -t,--table <table>  table to be created
 
 \textbf{merge}
@@ -426,20 +447,20 @@
     usage: merge [-?] [-b <arg>] [-e <arg>] [-f] [-s <arg>] [-t <table>]
[-v]
     description: merge tablets in a table
       -?,--help  display this help
-      -b,--begin-row <arg>	begin row
+      -b,--begin-row <arg>  begin row
       -e,--end-row <arg>  end row
-      -f,--force  merge small tablets to large tablets, even if it goes over the
-    	      given size
+      -f,--force  merge small tablets to large tablets, even if it goes over the given
+              size
       -s,--size <arg>  merge tablets to the given size over the entire table
       -t,--tableName <table>  table to be merged
-      -v,--verbose	verbose output during merge
+      -v,--verbose  verbose output during merge
 
 \textbf{notable}
 
     usage: notable [-?] [-t <arg>]
     description: returns to a tableless shell state
       -?,--help  display this help
-      -t,--tableName <arg>	Returns to a no table state
+      -t,--tableName <arg>  Returns to a no table state
 
 \textbf{offline}
 
@@ -483,47 +504,30 @@
       -?,--help  display this help
       -s,--system  revoke a system permission
       -t,--table <table>  revoke a table permission on this table
-      -u,--user <username>	user to operate on
+      -u,--user <username>  user to operate on
 
 \textbf{scan}
 
-    usage: scan [-?] [-b <start-row>] [-c <{<columnfamily>[:<columnqualifier>]}>]
[-e
-    	      <end-row>] [-f <int>] [-np] [-s <comma-separated-authorizations>]
-    	      [-st] [-t <table>]
+    usage: scan [-?] [-b <start-row>] [-c
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>]
+              [-e <end-row>] [-f <int>] [-fm <className>] [-np] [-r <row>]
[-s
+              <comma-separated-authorizations>] [-st] [-t <table>]
     description: scans the table, and displays the resulting records
       -?,--help  display this help
       -b,--begin-row <start-row>  begin row (inclusive)
-      -c,--columns <{<columnfamily>[:<columnqualifier>]}>  comma-separated
columns
+      -c,--columns
+              <<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}>

+              comma-separated columns
       -e,--end-row <end-row>  end row (inclusive)
       -f,--show few <int>  Only shows certain amount of characters
+      -fm,--formatter <className>  fully qualified name of the formatter class to use
       -np,--no-pagination  disables pagination of output
+      -r,--row <row>  row to scan
       -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-    	      (all user auths are used if this argument is not specified)
+              (all user auths are used if this argument is not specified)
       -st,--show-timestamps  enables displaying timestamps
       -t,--tableName <table>  table to be scanned
 
-\textbf{select}
-
-    usage: select <row> <columnfamily> <columnqualifier> [-?] [-np] [-s
-    	      <comma-separated-authorizations>] [-st] [-t <table>]
-    description: scans for and displays a single record
-      -?,--help  display this help
-      -np,--no-pagination  disables pagination of output
-      -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-      -st,--show-timestamps  enables displaying timestamps
-      -t,--tableName <table>  table
-
-\textbf{selectrow}
-
-    usage: selectrow <row> [-?] [-np] [-s <comma-separated-authorizations>] [-st]
[-t
-    	      <table>]
-    description: scans a single row and displays all resulting records
-      -?,--help  display this help
-      -np,--no-pagination  disables pagination of output
-      -s,--scan-authorizations <comma-separated-authorizations>  scan authorizations
-      -st,--show-timestamps  enables displaying timestamps
-      -t,--tableName <table>  table to row select
-
 \textbf{setauths}
 
     usage: setauths [-?] -c | -s <comma-separated-authorizations>  [-u <user>]
@@ -531,22 +535,22 @@
       -?,--help  display this help
       -c,--clear-authorizations  clears the scan authorizations
       -s,--scan-authorizations <comma-separated-authorizations>  set the scan
-    	      authorizations
+              authorizations
       -u,--user <user>  user to operate on
 
 \textbf{setgroups}
 
-    usage: setgroups <group>=<col fam>{,<col fam>}{ <group>=<col
fam>{,<col fam>}}
-    	      [-?] [-t <table>]
-    description: sets the locality groups for a given table (for binary or commas,
-    	      use Java API)
+    usage: setgroups <group>=<col fam>{,<col fam>}{ <group>=<col
fam>{,<col fam>}} [-?]
+              [-t <table>]
+    description: sets the locality groups for a given table (for binary or commas, use
+              Java API)
       -?,--help  display this help
       -t,--table <table>  get locality groups for specified table
 
 \textbf{setiter}
 
     usage: setiter [-?] -ageoff | -agg | -class <name> | -regex | -reqvis | -vers 
-    	      [-majc] [-minc] [-n <itername>] -p <pri>	[-scan] [-t <table>]
+              [-majc] [-minc] [-n <itername>] -p <pri>  [-scan] [-t <table>]
     description: sets a table-specific iterator
       -?,--help  display this help
       -ageoff,--ageoff  an aging off type
@@ -554,27 +558,27 @@
       -class,--class-name <name>  a java class type
       -majc,--major-compaction  applied at major compaction
       -minc,--minor-compaction  applied at minor compaction
-      -n,--name <itername>	iterator to set
+      -n,--name <itername>  iterator to set
       -p,--priority <pri>  the order in which the iterator is applied
       -regex,--regular-expression  a regex matching type
-      -reqvis,--require-visibility	a type that omits entries with empty visibilities
+      -reqvis,--require-visibility  a type that omits entries with empty visibilities
       -scan,--scan-time  applied at scan time
       -t,--table <table>  tableName
       -vers,--version  a versioning type
 
 \textbf{setscaniter}
 
-    usage: setscaniter [-?] -ageoff | -agg | -class <name> | -regex | -reqvis | -vers
-    	       [-n <itername>] -p <pri>  [-t <table>]
+    usage: setscaniter [-?] -ageoff | -agg | -class <name> | -regex | -reqvis | -vers

+              [-n <itername>] -p <pri>  [-t <table>]
     description: sets a table-specific scan iterator for this shell session
       -?,--help  display this help
       -ageoff,--ageoff  an aging off type
       -agg,--aggregator  an aggregating type
       -class,--class-name <name>  a java class type
-      -n,--name <itername>	iterator to set
+      -n,--name <itername>  iterator to set
       -p,--priority <pri>  the order in which the iterator is applied
       -regex,--regular-expression  a regex matching type
-      -reqvis,--require-visibility	a type that omits entries with empty visibilities
+      -reqvis,--require-visibility  a type that omits entries with empty visibilities
       -t,--table <table>  tableName
       -vers,--version  a versioning type
 
@@ -640,5 +644,4 @@
     description: reports the current user name
       -?,--help  display this help
 
-
 \end{alltt}

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 15 21:02:14 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
-/incubator/accumulo/branches/1.4/src/core:1201902-1242521
+/incubator/accumulo/branches/1.4/src/core:1201902-1242521,1244690-1244693

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
Wed Feb 15 21:02:14 2012
@@ -658,6 +658,10 @@ public class Shell extends ShellOptions 
       Shell.printHelp(usage(), "description: " + this.description(), getOptionsWithHelp());
     }
     
+    public final void printHelp(int width) {
+      Shell.printHelp(usage(), "description: " + this.description(), getOptionsWithHelp(),
width);
+    }
+    
     // Get options with help
     public final Options getOptionsWithHelp() {
       Options opts = getOptions();
@@ -906,8 +910,12 @@ public class Shell extends ShellOptions 
   }
   
   private static final void printHelp(String usage, String description, Options opts) {
+    printHelp(usage, description, opts, Integer.MAX_VALUE);
+  }
+  
+  private static final void printHelp(String usage, String description, Options opts, int
width) {
     PrintWriter pw = new PrintWriter(System.err);
-    new HelpFormatter().printHelp(pw, Integer.MAX_VALUE, usage, description, opts, 2, 5,
null, true);
+    new HelpFormatter().printHelp(pw, width, usage, description, opts, 2, 5, null, true);
     pw.flush();
   }
   
@@ -939,7 +947,7 @@ public class Shell extends ShellOptions 
   public AuthInfo getCredentials() {
     return credentials;
   }
-
+  
   /**
    * Return the formatter for this table, .
    * 

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
Wed Feb 15 21:02:14 2012
@@ -180,7 +180,7 @@ public class CreateTableCommand extends 
     // Load custom formatter if set
     if (cl.hasOption(createTableOptFormatter.getOpt())) {
       String formatterClass = cl.getOptionValue(createTableOptFormatter.getOpt());
-
+      
       shellState.getConnector().tableOperations().setProperty(tableName, Property.TABLE_FORMATTER_CLASS.toString(),
formatterClass);
     }
     
@@ -215,7 +215,7 @@ public class CreateTableCommand extends 
     createTableOptCopyConfig.setArgName("table");
     createTableOptCopySplits.setArgName("table");
     createTableOptSplit.setArgName("filename");
-    createTableOptAgg.setArgName("{<columnfamily>[:<columnqualifier>]=<aggregation_class>}");
+    createTableOptAgg.setArgName("{<columnfamily>[:<columnqualifier>]=<aggregation
class>}");
     createTableOptFormatter.setArgName("className");
     
     // Splits and CopySplits are put in an optionsgroup to make them

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteRowsCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteRowsCommand.java?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteRowsCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteRowsCommand.java
Wed Feb 15 21:02:14 2012
@@ -54,7 +54,7 @@ public class DeleteRowsCommand extends C
   
   @Override
   public String description() {
-    return "delete a range of rows in a table\nNote that rows matching the start row ARE
NOT deleted, but rows matching the end row ARE deleted.";
+    return "delete a range of rows in a table.  Note that rows matching the start row ARE
NOT deleted, but rows matching the end row ARE deleted.";
   }
   
   @Override

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java?rev=1244721&r1=1244720&r2=1244721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/HelpCommand.java
Wed Feb 15 21:02:14 2012
@@ -30,19 +30,52 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 
 public class HelpCommand extends Command {
-  
   private Option disablePaginationOpt;
+  private Option noWrapOpt;
   
   public int execute(String fullCommand, CommandLine cl, Shell shellState) throws ShellCommandException,
IOException {
+    int numColumns = shellState.getReader().getTermwidth();
+    if (cl.hasOption(noWrapOpt.getOpt()))
+      numColumns = Integer.MAX_VALUE;
+    
     // print help summary
     if (cl.getArgs().length == 0) {
       int i = 0;
       for (String cmd : shellState.commandFactory.keySet())
         i = Math.max(i, cmd.length());
+      if (numColumns < 40)
+        throw new IllegalArgumentException("numColumns must be at least 40 (was " + numColumns
+ ")");
       ArrayList<String> output = new ArrayList<String>();
       for (Command c : shellState.commandFactory.values()) {
-        if (!(c instanceof HiddenCommand))
-          output.add(String.format("%-" + i + "s  -  %s", c.getName(), c.description()));
+        if (!(c instanceof HiddenCommand)) {
+          String n = c.getName();
+          String s = c.description();
+          if (s == null)
+            s = "";
+          int beginIndex = 0;
+          int endIndex = s.length();
+          while (beginIndex < endIndex && s.charAt(beginIndex) == ' ')
+            beginIndex++;
+          String dash = "-";
+          while (endIndex > beginIndex && endIndex - beginIndex + i + 5 > numColumns)
{
+            endIndex = s.lastIndexOf(" ", numColumns + beginIndex - i - 5);
+            if (endIndex == -1 || endIndex < beginIndex) {
+              endIndex = numColumns + beginIndex - i - 5 - 1;
+              output.add(String.format("%-" + i + "s  %s  %s-", n, dash, s.substring(beginIndex,
endIndex)));
+              dash = " ";
+              beginIndex = endIndex;
+            } else {
+              output.add(String.format("%-" + i + "s  %s  %s", n, dash, s.substring(beginIndex,
endIndex)));
+              dash = " ";
+              beginIndex = endIndex + 1;
+            }
+            n = "";
+            endIndex = s.length();
+            while (beginIndex < endIndex && s.charAt(beginIndex) == ' ')
+              beginIndex++;
+          }
+          output.add(String.format("%-" + i + "s  %s  %s", n, dash, s.substring(beginIndex,
endIndex)));
+        }
       }
       shellState.printLines(output.iterator(), !cl.hasOption(disablePaginationOpt.getOpt()));
     }
@@ -53,7 +86,7 @@ public class HelpCommand extends Command
       if (c == null)
         shellState.getReader().printString(String.format("Unknown command \"%s\".  Enter
\"help\" for a list possible commands.\n", cmd));
       else
-        c.printHelp();
+        c.printHelp(numColumns);
     }
     return 0;
   }
@@ -71,6 +104,8 @@ public class HelpCommand extends Command
     Options o = new Options();
     disablePaginationOpt = new Option("np", "no-pagination", false, "disables pagination
of output");
     o.addOption(disablePaginationOpt);
+    noWrapOpt = new Option("nw", "no-wrap", false, "disables wrapping of output");
+    o.addOption(noWrapOpt);
     return o;
   }
   

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 15 21:02:14 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
-/incubator/accumulo/branches/1.4/src/server:1201902-1242521
+/incubator/accumulo/branches/1.4/src/server:1201902-1242521,1244690-1244693



Mime
View raw message