README.md in term_utils-0.3.2 vs README.md in term_utils-0.4.0
- old
+ new
@@ -1,26 +1,65 @@
# term_utils
-Terminal utilities for ruby.
-
## Purpose
-Provides terminal utilities like table formatting.
+Provides utilities like argument parsing, table formatting and file finding.
+## Getting Started
+
+Install term_utils at the command prompt:
+
+ gem install term_utils
+
+Require term_utils in the source file:
+
+ require 'term_utils'
+
## Content
-### Table formatting
+### Argument Parsing
+Exmaple:
+
+ require 'term_utils/ap'
+ syntax = TermUtils::AP.create_syntax do |s|
+ s.define_parameter :limit do |p|
+ p.define_flag '-l'
+ p.define_article
+ end
+ s.define_parameter :path do |p|
+ p.max_occurs = nil
+ p.define_article
+ end
+ end
+ limit = nil
+ paths = []
+ TermUtils::AP.parse_arguments(syntax, ARGV) do |on|
+ on.parameter :limit do |p|
+ limit = p.value
+ end
+ on.parameter :path do |p|
+ paths << p.value
+ end
+ end
+ puts "limit: #{limit}"
+ puts "paths:"
+ paths.each { |p| puts " #{p}" }
+
+See the [manual](manual/ARGUMENT_PARSING.md) for more details.
+
+### Table Formatting
+
Take the following table:
- id string8 string16
+ id string8 string16
---- -------- ----------------
- 1 Fiat Lux Fiat Lux
- 2 Alea ... Alea jacta est
+ 1 Fiat Lux Fiat Lux
+ 2 Alea ... Alea jacta est
3 Audac... Audaces fortuna juvat
---- -------- ----------------
- id string8 string16
+ id string8 string16
You can produce it with the following code:
require 'term_utils/tab'
@@ -45,20 +84,16 @@
tpr.separator
tpr.header
tpr.line
end
-### Argument Parsing
+### File Finding
-The Argument Parsing module provides a way to parse command line arguments.
+The File Finding module provides a way to query the filesystem.
-See Samples.
+## Version History
-### File Finder
-
-The File Finder module provides a way to query the filesystem.
-
-See the samples.
+[CHANGELOG](CHANGELOG.md)
## License
GPL-3.0-only.