Skip to content

Commit

Permalink
Update some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zorael committed Aug 8, 2020
1 parent 3bbe2db commit 49e3a9d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions source/kameloso/getopt.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import std.typecons : Flag, No, Yes;
+
+ if (results.helpWanted)
+ {
+ printHelp(results);
+ printHelp(results, No.monochrome, No.brightTerminal);
+ }
+ ---
+
Expand Down Expand Up @@ -227,7 +227,7 @@ public:
+ Example:
+ ---
+ Kameloso instance;
+ Next next = instance.handleGetopt(args);
+ Next next = instance.handleGetopt(args, customSettings);
+
+ if (next == Next.returnSuccess) return 0;
+ // ...
Expand Down
2 changes: 1 addition & 1 deletion source/kameloso/plugins/printer/logging.d
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void onLoggableEventImpl(PrinterPlugin plugin, const IRCEvent event)
+ Example:
+ ---
+ assert(!("~/logs".isDir));
+ bool locationIsOkay = establishLogLocation("~/logs");
+ bool locationIsOkay = plugin.establishLogLocation("~/logs");
+ assert("~/logs".isDir);
+ ---
+
Expand Down
2 changes: 1 addition & 1 deletion source/kameloso/plugins/sedreplace.d
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct Line
+ ---
+ string line = "This is a line";
+ string expression = "s/s/z/g";
+ assert(line.sedReplace(expression) == "Thiz iz a line");
+ assert(line.sedReplace(expression, No.relaxSyntax) == "Thiz iz a line");
+ ---
+
+ Params:
Expand Down
8 changes: 4 additions & 4 deletions source/kameloso/plugins/twitchbot/api.d
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct QueryResponse
+
+ Example:
+ ---
+ spawn(&persistentQuerier, plugin.bucket, plugin.queryResponseTimeout);
+ spawn(&persistentQuerier, plugin.bucket, plugin.queryResponseTimeout, caBundleFile);
+ ---
+
+ Params:
Expand Down Expand Up @@ -462,9 +462,9 @@ in (Fiber.getThis, "Tried to call `queryTwitch` from outside a Fiber")
+ ---
+ immutable url = "https://api.twitch.tv/helix/some/api/url";
+
+ spawn&(&queryTwitchImpl, url, plugin.authorizationBearer, plugin.queryResponseTimeout, plugin.bucket);
+ spawn&(&queryTwitchImpl, url, plugin.authorizationBearer, plugin.queryResponseTimeout, plugin.bucket, caBundleFile);
+ delay(plugin, plugin.approximateQueryTime, Yes.msecs, Yes.yield);
+ const response = waitForQueryResponse(plugin, url, plugin.twitchBotSettings.singleWorkerThread);
+ const response = waitForQueryResponse(plugin, url);
+ // response.str is the response body
+ ---
+
Expand Down Expand Up @@ -841,7 +841,7 @@ void averageApproximateQueryTime(TwitchBotPlugin plugin, const long responseMsec
+ }
+
+ delay(plugin, plugin.approximateQueryTime, Yes.msecs, Yes.yield);
+ const response = waitForQueryResponse(plugin, url, plugin.twitchBotSettings.singleWorkerThread);
+ const response = waitForQueryResponse(plugin, url);
+ // response.str is the response body
+ ---
+
Expand Down
4 changes: 2 additions & 2 deletions source/kameloso/printing.d
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ if (isOutputRange!(Sink, char[]))
+
+ Foo foo, bar;
+
+ writeln(formatObjects!(Yes.coloured)(foo));
+ writeln(formatObjects!(No.coloured)(bar));
+ writeln(formatObjects!(No.all, Yes.coloured)(foo));
+ writeln(formatObjects!(Yes.all, No.coloured)(bar));
+ ---
+
+ Params:
Expand Down
2 changes: 1 addition & 1 deletion source/kameloso/terminal.d
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ unittest
+
+ Example:
+ ---
+ immutable colouredNick = "kameloso".colourByHash;
+ immutable colouredNick = "kameloso".colourByHash(No.bright);
+ immutable colouredNickBright = "kameloso".colourByHash(Yes.bright);
+ ---
+
Expand Down

0 comments on commit 49e3a9d

Please sign in to comment.