From: Adrián Medraño Calvo Date: Thu, 30 Aug 2018 09:29:02 +0000 (+0200) Subject: tcldot: downcase error messages X-Git-Tag: 2.42.0~49^2^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2ec9fa629f87dd8f470766aa5df069e2e69ab70;p=graphviz tcldot: downcase error messages --- diff --git a/tclpkg/tcldot/tcldot-edgecmd.c b/tclpkg/tcldot/tcldot-edgecmd.c index 2ac835f02..020fb4814 100644 --- a/tclpkg/tcldot/tcldot-edgecmd.c +++ b/tclpkg/tcldot/tcldot-edgecmd.c @@ -29,12 +29,12 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, gctx_t *gctx = (gctx_t *)clientData; if (argc < 2) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], "\" option ?arg arg ...?", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" option ?arg arg ...?", NULL); return TCL_ERROR; } e = cmd2e(argv[0]); if (!e) { - Tcl_AppendResult(interp, "Edge \"", argv[0], "\" not found", NULL); + Tcl_AppendResult(interp, "edge \"", argv[0], "\" not found", NULL); return TCL_ERROR; } g = agraphof(agtail(e)); @@ -65,7 +65,7 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, if ((a = agfindedgeattr(g, argv2[j]))) { Tcl_AppendElement(interp, agxget(e, a)); } else { - Tcl_AppendResult(interp, "No attribute named \"", argv2[j], "\"", NULL); + Tcl_AppendResult(interp, "no attribute named \"", argv2[j], "\"", NULL); return TCL_ERROR; } } @@ -84,7 +84,7 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, Tcl_AppendElement(interp, argv2[j]); Tcl_AppendElement(interp, agxget(e, a)); } else { - Tcl_AppendResult(interp, "No attribute named \"", argv2[j], "\"", NULL); + Tcl_AppendResult(interp, "no attribute named \"", argv2[j], "\"", NULL); return TCL_ERROR; } } @@ -99,7 +99,7 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, (CONST84 char ***) &argv2) != TCL_OK) return TCL_ERROR; if ((argc2 == 0) || (argc2 % 2)) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?", NULL); Tcl_Free((char *) argv2); @@ -109,7 +109,7 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, Tcl_Free((char *) argv2); } else { if ((argc < 4) || (argc % 2)) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?", NULL); return TCL_ERROR; @@ -127,7 +127,7 @@ int edgecmd(ClientData clientData, Tcl_Interp * interp, return TCL_OK; } else { - Tcl_AppendResult(interp, "Bad option \"", argv[1], + Tcl_AppendResult(interp, "bad option \"", argv[1], "\": must be one of:", "\n\tdelete, listattributes, listnodes,", "\n\tueryattributes, queryattributevalues,", diff --git a/tclpkg/tcldot/tcldot-graphcmd.c b/tclpkg/tcldot/tcldot-graphcmd.c index 1e216fdce..82e68eaa6 100644 --- a/tclpkg/tcldot/tcldot-graphcmd.c +++ b/tclpkg/tcldot/tcldot-graphcmd.c @@ -35,12 +35,12 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, GVJ_t *job = gvc->job; if (argc < 2) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", NULL); return TCL_ERROR; } g = cmd2g(argv[0]); if (!g) { - Tcl_AppendResult(interp, "Graph \"", argv[0], "\" not found", NULL); + Tcl_AppendResult(interp, "graph \"", argv[0], "\" not found", NULL); return TCL_ERROR; } @@ -49,7 +49,7 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, if (MATCHES_OPTION("addedge", argv[1], c, length)) { if ((argc < 4) || (argc % 2)) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " addedge tail head ?attributename attributevalue? ?...?\"", NULL); return TCL_ERROR; @@ -57,23 +57,23 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, tail = cmd2n(argv[2]); if (!tail) { if (!(tail = agfindnode(g, argv[2]))) { - Tcl_AppendResult(interp, "Tail node \"", argv[2], "\" not found.", NULL); + Tcl_AppendResult(interp, "tail node \"", argv[2], "\" not found.", NULL); return TCL_ERROR; } } if (agroot(g) != agroot(agraphof(tail))) { - Tcl_AppendResult(interp, "Tail node ", argv[2], " is not in the graph.", NULL); + Tcl_AppendResult(interp, "tail node ", argv[2], " is not in the graph.", NULL); return TCL_ERROR; } head = cmd2n(argv[3]); if (!head) { if (!(head = agfindnode(g, argv[3]))) { - Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL); + Tcl_AppendResult(interp, "head node \"", argv[3], "\" not found.", NULL); return TCL_ERROR; } } if (agroot(g) != agroot(agraphof(head))) { - Tcl_AppendResult(interp, "Head node ", argv[3], " is not in the graph.", NULL); + Tcl_AppendResult(interp, "head node ", argv[3], " is not in the graph.", NULL); return TCL_ERROR; } e = agedge(g, tail, head, NULL, 1); @@ -133,15 +133,15 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, return TCL_ERROR; } if (!(tail = agfindnode(g, argv[2]))) { - Tcl_AppendResult(interp, "Tail node \"", argv[2], "\" not found.", NULL); + Tcl_AppendResult(interp, "tail node \"", argv[2], "\" not found.", NULL); return TCL_ERROR; } if (!(head = agfindnode(g, argv[3]))) { - Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL); + Tcl_AppendResult(interp, "head node \"", argv[3], "\" not found.", NULL); return TCL_ERROR; } if (!(e = agfindedge(g, tail, head))) { - Tcl_AppendResult(interp, "Edge \"", argv[2], " - ", argv[3], "\" not found.", NULL); + Tcl_AppendResult(interp, "edge \"", argv[2], " - ", argv[3], "\" not found.", NULL); return TCL_ERROR; } Tcl_AppendElement(interp, obj2cmd(e)); @@ -153,7 +153,7 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, return TCL_ERROR; } if (!(n = agfindnode(g, argv[2]))) { - Tcl_AppendResult(interp, "Node not found.", NULL); + Tcl_AppendResult(interp, "node not found.", NULL); return TCL_ERROR; } Tcl_AppendResult(interp, obj2cmd(n), NULL); @@ -516,7 +516,7 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, } if (i == NO_SUPPORT) { const char *s = gvplugin_list(gvc, API_render, argv[3]); - Tcl_AppendResult(interp, "Bad langname: \"", argv[3], "\". Use one of:", s, NULL); + Tcl_AppendResult(interp, "bad langname: \"", argv[3], "\". Use one of:", s, NULL); return TCL_ERROR; } @@ -537,11 +537,11 @@ int graphcmd(ClientData clientData, Tcl_Interp * interp, chan = Tcl_GetChannel(interp, argv[2], &mode); if (!chan) { - Tcl_AppendResult(interp, "Channel not open: \"", argv[2], NULL); + Tcl_AppendResult(interp, "channel not open: \"", argv[2], NULL); return TCL_ERROR; } if (!(mode & TCL_WRITABLE)) { - Tcl_AppendResult(interp, "Channel not writable: \"", argv[2], NULL); + Tcl_AppendResult(interp, "channel not writable: \"", argv[2], NULL); return TCL_ERROR; } job->output_file = (FILE *)chan; diff --git a/tclpkg/tcldot/tcldot-nodecmd.c b/tclpkg/tcldot/tcldot-nodecmd.c index a4be2f0cc..fb49e34bf 100644 --- a/tclpkg/tcldot/tcldot-nodecmd.c +++ b/tclpkg/tcldot/tcldot-nodecmd.c @@ -31,12 +31,12 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, gctx_t *gctx = (gctx_t *)clientData; if (argc < 2) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", NULL); return TCL_ERROR; } n = cmd2n(argv[0]); if (!n) { - Tcl_AppendResult(interp, "Node \"", argv[0], "\" not found", NULL); + Tcl_AppendResult(interp, "node \"", argv[0], "\" not found", NULL); return TCL_ERROR; } g = agraphof(n); @@ -47,18 +47,18 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, if (MATCHES_OPTION("addedge", argv[1], c, length)) { if ((argc < 3) || (!(argc % 2))) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " addedge head ?attributename attributevalue? ?...?\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " addedge head ?attributename attributevalue? ?...?\"", NULL); return TCL_ERROR; } head = cmd2n(argv[2]); if (!head) { if (!(head = agfindnode(g, argv[2]))) { - Tcl_AppendResult(interp, "Head node \"", argv[2], "\" not found.", NULL); + Tcl_AppendResult(interp, "head node \"", argv[2], "\" not found.", NULL); return TCL_ERROR; } } if (agroot(g) != agroot(agraphof(head))) { - Tcl_AppendResult(interp, "Nodes ", argv[0], " and ", argv[2], " are not in the same graph.", NULL); + Tcl_AppendResult(interp, "nodes ", argv[0], " and ", argv[2], " are not in the same graph.", NULL); return TCL_ERROR; } e = agedge(g, n, head, NULL, 1); @@ -72,15 +72,15 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, } else if (MATCHES_OPTION("findedge", argv[1], c, length)) { if (argc < 3) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " findedge headnodename\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " findedge headnodename\"", NULL); return TCL_ERROR; } if (!(head = agfindnode(g, argv[2]))) { - Tcl_AppendResult(interp, "Head node \"", argv[2], "\" not found.", NULL); + Tcl_AppendResult(interp, "head node \"", argv[2], "\" not found.", NULL); return TCL_ERROR; } if (!(e = agfindedge(g, n, head))) { - Tcl_AppendResult(interp, "Edge \"", argv[0], " - ", obj2cmd(head), "\" not found.", NULL); + Tcl_AppendResult(interp, "edge \"", argv[0], " - ", obj2cmd(head), "\" not found.", NULL); return TCL_ERROR; } Tcl_AppendElement(interp, obj2cmd(head)); @@ -118,7 +118,7 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, if ((a = agfindnodeattr(g, argv2[j]))) { Tcl_AppendElement(interp, agxget(n, a)); } else { - Tcl_AppendResult(interp, "No attribute named \"", argv2[j], "\"", NULL); + Tcl_AppendResult(interp, "no attribute named \"", argv2[j], "\"", NULL); return TCL_ERROR; } } @@ -137,7 +137,7 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, Tcl_AppendElement(interp, argv2[j]); Tcl_AppendElement(interp, agxget(n, a)); } else { - Tcl_AppendResult(interp, "No attribute named \"", argv2[j], "\"", NULL); + Tcl_AppendResult(interp, "no attribute named \"", argv2[j], "\"", NULL); return TCL_ERROR; } } @@ -153,7 +153,7 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, (CONST84 char ***) &argv2) != TCL_OK) return TCL_ERROR; if ((argc2 == 0) || (argc2 % 2)) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?", NULL); Tcl_Free((char *) argv2); @@ -163,7 +163,7 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, Tcl_Free((char *) argv2); } else { if ((argc < 4) || (argc % 2)) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?", NULL); return TCL_ERROR; @@ -177,7 +177,7 @@ int nodecmd(ClientData clientData, Tcl_Interp * interp, return TCL_OK; } else { - Tcl_AppendResult(interp, "Bad option \"", argv[1], + Tcl_AppendResult(interp, "bad option \"", argv[1], "\": must be one of:", "\n\taddedge, listattributes, listedges, listinedges,", "\n\tlistoutedges, queryattributes, queryattributevalues,", diff --git a/tclpkg/tcldot/tcldot.c b/tclpkg/tcldot/tcldot.c index 9006ca0e9..6fee51f7d 100644 --- a/tclpkg/tcldot/tcldot.c +++ b/tclpkg/tcldot/tcldot.c @@ -85,7 +85,7 @@ static int dotread(ClientData clientData, Tcl_Interp * interp, ictx->myioDisc.afread = myiodisc_afread; /* replace afread to use Tcl Channels */ if (argc < 2) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " fileHandle\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " fileHandle\"", NULL); return TCL_ERROR; } channel = Tcl_GetChannel(interp, argv[1], &mode); @@ -133,7 +133,7 @@ static int dotstring(ClientData clientData, Tcl_Interp * interp, rdr.cur = 0; if (argc < 2) { - Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " string\"", NULL); + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " string\"", NULL); return TCL_ERROR; } /* agmemread() is broken for our use because it replaces the id disc */