Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
pointybeard committed Jun 2, 2015
1 parent c46e066 commit 54cc4f6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The following are examples of supported command syntax:
-u http://www.theproject.com
-y something
-p:\Users\pointybeard\Sites\shellargs\
-p:"\Users\pointybeard\Sites"
-h:local:host
-p:"\Users\pointybeard\Sites"
-h:local:host
/host=local-host
```

Expand All @@ -35,7 +35,7 @@ The following are examples of supported command syntax:
use pointybeard\ShellArgs\Lib;

// Load up the arguments from $argv. By default
// it will ignore the first item, which is the
// it will ignore the first item, which is the
// script name
$args = new ArgumentIterator();

Expand All @@ -52,9 +52,12 @@ $args = new ArgumentIterator(false, [

// Iterate over all the arguments
foreach($args as $a){
printf("%s => %s" . PHP_EOL, $a->name, $a->value);
printf("%s => %s" . PHP_EOL, $a->name(), $a->value());
}

// Find a specific argument by name
$args->find('i');

// Find also accepts and array of values, returning the first one that is valid
$args->find(['h', 'help', 'usage']);
```

0 comments on commit 54cc4f6

Please sign in to comment.