Changeset 513

Show
Ignore:
Timestamp:
08/29/08 19:33:40 (3 months ago)
Author:
ogawa
Message:

Add --uid, --no-uid, --url, --no-url for CLI options.

Location:
cybozu2ical/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cybozu2ical/trunk/README.txt

    r510 r513  
    4949    --output-csv /path/to/output.csv 
    5050        Specify the output CSV file for debugging. 
     51 
     52    --uid, --no-uid 
     53        Enable/disable UID fields of the iCalendar file. 
     54 
     55    --url, --no-url 
     56        Enable/disable URL fields of the iCalendar file. 
    5157 
    5258    --help 
  • cybozu2ical/trunk/cybozu2ical

    r510 r513  
    8989    conf                     => 'config.yaml', 
    9090    'compat-google-calendar' => 0, 
     91    'uid'                    => 1, 
     92    'url'                    => 1, 
    9193); 
    9294GetOptions( \%opt, 'output=s', 'conf=s', 'compat-google-calendar', 'debug', 
    93     'input-csv=s', 'output-csv=s', 'help', ) 
     95    'input-csv=s', 'output-csv=s', 'help', 'uid!', 'url!' ) 
    9496  or pod2usage(2); 
    9597pod2usage(1) if $opt{help}; 
     
    137139        created     => to_icaldate( $item->created ), 
    138140        dtstamp     => to_icaldate( $item->modified ), 
    139         url         => $cal->url . '?page=ScheduleView&EID=' . $item->id, 
     141        $opt{url} 
     142        ? ( url => $cal->url . '?page=ScheduleView&EID=' . $item->id ) 
     143        : (), 
    140144    ); 
    141145 
     
    188192 
    189193    # set uid (recommended to be the identical syntax to RFC822) 
    190     my $host = URI->new($cal->url)->host || 'localhost'; 
    191     $args{uid} = $args{created} . '-' . $item->id . '@' . $host; 
     194    if ( $opt{uid} ) { 
     195        my $host = URI->new( $cal->url )->host || 'localhost'; 
     196        $args{uid} = $args{created} . '-' . $item->id . '@' . $host; 
     197    } 
    192198 
    193199    $vevent->add_properties(%args); 
     
    313319Specify the output CSV file for debugging. 
    314320 
     321=item --uid, --no-uid 
     322 
     323Enable/disable UID fields of the iCalendar file. 
     324 
     325=item --url, --no-url 
     326 
     327Enable/disable URL fields of the iCalendar file. 
     328 
    315329=item --help 
    316330