relpipe-data/examples-grep-cut-fstab.xml
branchv_0
changeset 326 ab7f333f1225
parent 325 4560c5623d7d
--- a/relpipe-data/examples-grep-cut-fstab.xml	Tue May 11 21:35:54 2021 +0200
+++ b/relpipe-data/examples-grep-cut-fstab.xml	Tue May 11 22:26:48 2021 +0200
@@ -29,7 +29,7 @@
 		
 		<m:pre jazyk="bash"><![CDATA[relpipe-in-fstab \
 	| relpipe-tr-grep --relation 'fstab' --attribute 'type' --value '^btrfs|xfs$' \
-	| relpipe-tr-cut 'fstab' 'mount_point' \
+	| relpipe-tr-cut --relation 'fstab' --attribute 'mount_point' \
 	| relpipe-out-nullbyte \
 	| while read -r -d '' m; do
 		echo "$m";
@@ -88,7 +88,7 @@
 
 		<p>We can put away the <code>a</code> attribute from the <code>numbers</code> relation:</p>
 		
-		<m:pre jazyk="bash">cat both.rp | relpipe-tr-cut 'numbers' 'b|c' | relpipe-out-tabular</m:pre>
+		<m:pre jazyk="bash">cat both.rp | relpipe-tr-cut --relation 'numbers' --attribute 'b|c' | relpipe-out-tabular</m:pre>
 		
 		<p>and leave the <code>letters</code> relation unaffected:</p>
 		
@@ -112,7 +112,7 @@
 
 		<p>Or we can remove <code>a</code> from both relations resp. keep there only attributes whose names match <code>'b|c'</code> regex:</p>
 
-		<m:pre jazyk="bash">cat both.rp | relpipe-tr-cut '.*' 'b|c' | relpipe-out-tabular</m:pre>
+		<m:pre jazyk="bash">cat both.rp | relpipe-tr-cut --relation '.*' --attribute 'b|c' | relpipe-out-tabular</m:pre>
 		
 		<p>Instead of <code>'.*'</code> we could use <code>'numbers|letters'</code> and in this case it will give the same result:</p>
 		
@@ -136,7 +136,9 @@
 
 		<p>All the time, we are reducing the attributes. But we can also multiply them or change their order:</p>
 		
-		<m:pre jazyk="bash">cat both.rp | relpipe-tr-cut 'numbers' 'b|a|c' 'b' 'a' 'a' | relpipe-out-tabular</m:pre>
+		<m:pre jazyk="bash">cat both.rp \
+	| relpipe-tr-cut --relation 'numbers' --attribute 'b|a|c' --attribute 'b' --attribute 'a' --attribute 'a' \
+	| relpipe-out-tabular</m:pre>
 		
 		<p>
 			n.b. the order in <code>'b|a|c'</code> does not matter and if such regex matches, it preserves the original order of the attributes;
@@ -162,7 +164,7 @@
 Record count: 2]]></pre>
 
 		<p>
-			The <code>letters</code> relation stays rock steady and <code>relpipe-tr-cut 'numbers'</code> does not affect it in any way.
+			The <code>letters</code> relation stays rock steady and <code>relpipe-tr-cut --relation 'numbers'</code> does not affect it in any way.
 		</p>
 		
 		<h2>Process CSV files</h2>
@@ -195,7 +197,7 @@
 		<m:pre jazyk="bash"><![CDATA[cat tasks.csv \
 	| relpipe-in-csv \
 	| relpipe-tr-grep --relation 'csv' --attribute 'type' --value 'FIXME' \
-	| relpipe-tr-cut 'csv' 'file|description' \
+	| relpipe-tr-cut  --relation 'csv' --attribute 'file|description' \
 	| relpipe-out-tabular]]></m:pre>
 	
 		<p>and get result like this:</p>