--- mail2lj/mail2lj.pl 2007/08/13 15:06:38 1.3 +++ mail2lj/mail2lj.pl 2007/08/14 04:19:50 1.4 @@ -139,6 +139,7 @@ my $Parse = GetOptions( \%Opt, 'prop_opt_backdated|backdated|back-dated|backdate|back-date|back!', 'subject|subj|s=s', 'taglist|tags|tag|t=s' => \@opt_taglist, # Will tweak + 'notaglist|notags|notag|not|no-taglist|no-tags|no-tag|no-t' => sub {undef @opt_taglist}, 'usejournal|use-journal|use|journal|j=s', 'prop_current_mood|current_mood|mood=s', 'prop_current_music|current_music|music=s', @@ -522,7 +523,12 @@ sub post_body2href { # Changed by LG - added 'tags' option. } elsif ($var =~ /^tags?$/ || $var eq "taglist") { - $req_data->{prop_taglist} = $val; + $req_data->{prop_taglist} = $val; + + # Changed by LG - added 'notags' option. Empty the preceding + # taglist if set to true, otherwise do nothing + } elsif ($var =~ /^no-?tags?$/ || $var eq "no-?taglist") { + $req_data->{prop_taglist} = "" if $val =~ /^\s*((on)|(yes))\s*$/i ; # Anything else - just assign. } else { @@ -898,6 +904,12 @@ Options: single or double quotes to protect from the shell. Multiple '-t' options are allowed and taglists will be combined. +--notaglist, --notags + Unsets all previously defined tags. Thus, a call to + $shortname ... --tags X --tags Y ... --notags --tags Z + will yield a taglist consisting of just "Z". This option is + rarely needed and added only for the sake of completeness. + -d DATE, --date DATE Label posting with this date. Date should be in LiveJournal's format: DD.MM.YYYY HH:mm. If absent, current date/time is used. @@ -1007,6 +1019,7 @@ command line options), they should look Security: private Subject: Rzhevskij zhiv! Tags: Junk, Viva Rzhevskij! + Notags: yes # Clears all preceding tags Formatted: on # Or equivalent "Autoformat: off" Usejournal: gusary Mood: okay