Changeset 3265 for libcaca/trunk


Ignore:
Timestamp:
Nov 4, 2008, 4:36:33 AM (11 years ago)
Author:
bsittler
Message:

list available import formats in usage message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/import.php

    r3264 r3265  
    1919 */
    2020
    21 if($argc < 2)
     21$imports = caca_get_import_list();
     22
     23if($argc < 2 || $argc > 3)
    2224{
    23         die($argv[0] . ": missing argument (filename).\n" .
    24                 "usage: " . $argv[0] . " <filename> [<format>]\n");
     25        $msg = ($argv[0] . ": wrong argument count\n" .
     26                        "usage: " . $argv[0] . " file [<format>]\n" .
     27                        "where <format> is one of:\n");
     28        foreach($imports as $format => $name)
     29                $msg .= " \"" . $name . "\" (" . $format . ")\n";
     30        die($msg);
    2531}
    2632
Note: See TracChangeset for help on using the changeset viewer.