From a1fda0b516cc4e85b7304838949df8fbe0044cf3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 1 Mar 2015 16:14:32 +0000 Subject: Standardize on --long-option instead of -long-option [[forum/refresh_and_setup]] indicates some confusion between --setup and -setup. Both work, but it's clearer if we stick to one in documentation and code. A 2012 commit to [[plugins/theme]] claims that "-setup" is required and "--setup" won't work, but I cannot find any evidence in ikiwiki's source code that this has ever been the case. --- t/basewiki_brokenlinks.t | 12 ++++++------ t/comments.t | 2 +- t/conflicts.t | 2 +- t/img.t | 2 +- t/inline.t | 4 ++-- t/permalink.t | 2 +- t/podcast.t | 26 +++++++++++++------------- t/trail.t | 6 +++--- 8 files changed, 28 insertions(+), 28 deletions(-) (limited to 't') diff --git a/t/basewiki_brokenlinks.t b/t/basewiki_brokenlinks.t index 74ddc61c5..249d625f6 100755 --- a/t/basewiki_brokenlinks.t +++ b/t/basewiki_brokenlinks.t @@ -8,14 +8,14 @@ ok(! system("make -s ikiwiki.out")); ok(! system("make underlay_install DESTDIR=`pwd`/t/tmp/install PREFIX=/usr >/dev/null")); foreach my $plugin ("", "listdirectives") { - ok(! system("LC_ALL=C perl -I. ./ikiwiki.out -rebuild -plugin brokenlinks ". + ok(! system("LC_ALL=C perl -I. ./ikiwiki.out --rebuild --plugin brokenlinks ". # always enabled because pages link to it conditionally, # which brokenlinks cannot handle properly - "-plugin smiley ". - ($plugin ? "-plugin $plugin " : ""). - "-underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki ". - "-set underlaydirbase=t/tmp/install/usr/share/ikiwiki ". - "-templatedir=templates t/basewiki_brokenlinks t/tmp/out")); + "--plugin smiley ". + ($plugin ? "--plugin $plugin " : ""). + "--underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki ". + "--set underlaydirbase=t/tmp/install/usr/share/ikiwiki ". + "--templatedir=templates t/basewiki_brokenlinks t/tmp/out")); my $result=`grep 'no broken links' t/tmp/out/index.html`; ok(length($result)); if (! length $result) { diff --git a/t/comments.t b/t/comments.t index da2148b6b..41e731c80 100755 --- a/t/comments.t +++ b/t/comments.t @@ -40,7 +40,7 @@ ok(utime(333333333, 333333333, "t/tmp/in/post/comment_1._comment")); # Build the wiki ok(! system("make -s ikiwiki.out")); -ok(! system("perl -I. ./ikiwiki.out -verbose -plugin comments -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -set underlaydirbase=underlays -set comments_pagespec='*' -templatedir=templates t/tmp/in t/tmp/out")); +ok(! system("perl -I. ./ikiwiki.out --verbose --plugin comments --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --set comments_pagespec='*' --templatedir=templates t/tmp/in t/tmp/out")); # Check that the comments are in the right order diff --git a/t/conflicts.t b/t/conflicts.t index d7e04d3ae..fae0e84c9 100755 --- a/t/conflicts.t +++ b/t/conflicts.t @@ -12,7 +12,7 @@ ok(! system("make -s ikiwiki.out")); # runs ikiwiki to build test site sub runiki { my $testdesc=shift; - ok((! system("perl -I. ./ikiwiki.out -plugin txt -plugin rawhtml -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates $srcdir $destdir @_")), + ok((! system("perl -I. ./ikiwiki.out --plugin txt --plugin rawhtml --underlaydir=underlays/basewiki --set underlaydirbase=underlays --templatedir=templates $srcdir $destdir @_")), $testdesc); } sub refreshiki { diff --git a/t/img.t b/t/img.t index 2ea3abb24..6c295737e 100755 --- a/t/img.t +++ b/t/img.t @@ -50,7 +50,7 @@ EOF ok(! system("make -s ikiwiki.out")); -my $command = "perl -I. ./ikiwiki.out -set usedirs=0 -templatedir=templates -plugin img t/tmp/in t/tmp/out -verbose"; +my $command = "perl -I. ./ikiwiki.out --set usedirs=0 --templatedir=templates --plugin img t/tmp/in t/tmp/out --verbose"; ok(! system($command)); diff --git a/t/inline.t b/t/inline.t index 726227b8f..e07658d98 100755 --- a/t/inline.t +++ b/t/inline.t @@ -35,11 +35,11 @@ foreach my $page (qw(protagonists/shepard protagonists/link ok(! system("make -s ikiwiki.out")); -my $command = "perl -I. ./ikiwiki.out -set usedirs=0 -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates t/tmp/in t/tmp/out -verbose"; +my $command = "perl -I. ./ikiwiki.out --set usedirs=0 --plugin inline --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --templatedir=templates t/tmp/in t/tmp/out --verbose"; ok(! system($command)); -ok(! system("$command -refresh")); +ok(! system("$command --refresh")); $blob = readfile("t/tmp/out/protagonists.html"); like($blob, qr{Add a new post}, 'rootpage=yes gives postform'); diff --git a/t/permalink.t b/t/permalink.t index 36be984c5..13a72fc56 100755 --- a/t/permalink.t +++ b/t/permalink.t @@ -6,7 +6,7 @@ use Test::More 'no_plan'; ok(! system("rm -rf t/tmp")); ok(! system("mkdir t/tmp")); ok(! system("make -s ikiwiki.out")); -ok(! system("perl -I. ./ikiwiki.out -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates t/tinyblog t/tmp/out")); +ok(! system("perl -I. ./ikiwiki.out --plugin inline --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --templatedir=templates t/tinyblog t/tmp/out")); # This guid should never, ever change, for any reason whatsoever! my $guid="http://example.com/post/"; ok(length `egrep '$guid' t/tmp/out/index.rss`); diff --git a/t/podcast.t b/t/podcast.t index 94505a05e..ef90b5205 100755 --- a/t/podcast.t +++ b/t/podcast.t @@ -23,10 +23,10 @@ sub podcast { my $podcast_style = shift; my $baseurl = 'http://example.com'; - my @command = (qw(./ikiwiki.out -plugin inline -rss -atom)); + my @command = (qw(./ikiwiki.out --plugin inline --rss --atom)); push @command, qw(-underlaydir=underlays/basewiki); - push @command, qw(-set underlaydirbase=underlays -templatedir=templates); - push @command, "-url=$baseurl", qw(t/tinypodcast), "$tmp/out"; + push @command, qw(-set underlaydirbase=underlays --templatedir=templates); + push @command, "--url=$baseurl", qw(t/tinypodcast), "$tmp/out"; ok(! system("mkdir $tmp"), q{setup}); @@ -115,7 +115,7 @@ sub podcast { sub single_page_html { my @command = (qw(./ikiwiki.out)); push @command, qw(-underlaydir=underlays/basewiki); - push @command, qw(-set underlaydirbase=underlays -templatedir=templates); + push @command, qw(-set underlaydirbase=underlays --templatedir=templates); push @command, qw(t/tinypodcast), "$tmp/out"; ok(! system("mkdir $tmp"), @@ -130,7 +130,7 @@ sub single_page_html { q{html enclosure}); my ($href) = _extract_html_links($html, 'piano'); is($href, '/piano.mp3', - q{html enclosure sans -url is site-absolute}); + q{html enclosure sans --url is site-absolute}); $html = "$tmp/out/attempted_multiple_enclosures/index.html"; like(_extract_html_content($html, 'content'), qr/has content and/m, @@ -139,28 +139,28 @@ sub single_page_html { q{html enclosure}); ($href) = _extract_html_links($html, 'walter'); is($href, '/walter.ogg', - q{html enclosure sans -url is site-absolute}); + q{html enclosure sans --url is site-absolute}); my $baseurl = 'http://example.com'; - ok(! system(@command, "-url=$baseurl", q{--rebuild})); + ok(! system(@command, "--url=$baseurl", q{--rebuild})); $html = "$tmp/out/pianopost/index.html"; ($href) = _extract_html_links($html, 'piano'); is($href, "$baseurl/piano.mp3", - q{html enclosure with -url is fully absolute}); + q{html enclosure with --url is fully absolute}); $html = "$tmp/out/attempted_multiple_enclosures/index.html"; ($href) = _extract_html_links($html, 'walter'); is($href, "$baseurl/walter.ogg", - q{html enclosure with -url is fully absolute}); + q{html enclosure with --url is fully absolute}); ok(! system("rm -rf $tmp $statedir"), q{teardown}); } sub inlined_pages_html { - my @command = (qw(./ikiwiki.out -plugin inline)); + my @command = (qw(./ikiwiki.out --plugin inline)); push @command, qw(-underlaydir=underlays/basewiki); - push @command, qw(-set underlaydirbase=underlays -templatedir=templates); + push @command, qw(-set underlaydirbase=underlays --templatedir=templates); push @command, qw(t/tinypodcast), "$tmp/out"; ok(! system("mkdir $tmp"), @@ -179,10 +179,10 @@ sub inlined_pages_html { q{html enclosure}); my ($href) = _extract_html_links($html, 'piano.mp3'); is($href, '/piano.mp3', - q{html enclosure from pianopost sans -url}); + q{html enclosure from pianopost sans --url}); ($href) = _extract_html_links($html, 'walter.ogg'); is($href, '/walter.ogg', - q{html enclosure from attempted_multiple_enclosures sans -url}); + q{html enclosure from attempted_multiple_enclosures sans --url}); ok(! system("rm -rf $tmp $statedir"), q{teardown}); } diff --git a/t/trail.t b/t/trail.t index dce3b3c7e..bde812887 100755 --- a/t/trail.t +++ b/t/trail.t @@ -131,11 +131,11 @@ EOF ok(! system("make -s ikiwiki.out")); -my $command = "perl -I. ./ikiwiki.out -set usedirs=0 -plugin trail -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates t/tmp/in t/tmp/out -verbose"; +my $command = "perl -I. ./ikiwiki.out --set usedirs=0 --plugin trail --plugin inline --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --templatedir=templates t/tmp/in t/tmp/out --verbose"; ok(! system($command)); -ok(! system("$command -refresh")); +ok(! system("$command --refresh")); $blob = readfile("t/tmp/out/meme.html"); ok($blob =~ /badger<\/a>/m); @@ -232,7 +232,7 @@ writefile("limited/c.mdwn", "t/tmp/in", '[[!meta title="New C page"]]c'); writefile("untrail.mdwn", "t/tmp/in", "no longer a trail"); -ok(! system("$command -refresh")); +ok(! system("$command --refresh")); check_trail("add/a.html", "n=add/b p="); check_trail("add/b.html", "n=add/c p=add/a"); -- cgit v1.2.3