{"id":69,"date":"2024-09-25T08:27:47","date_gmt":"2024-09-25T07:27:47","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=69"},"modified":"2026-02-12T04:31:25","modified_gmt":"2026-02-12T04:31:25","slug":"mwnci-args-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-args-function\/","title":{"rendered":"Mwnci args() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>args()<\/p>\n<h2>Parameters<\/h2>\n<p>None<\/p>\n<h2>Description<\/h2>\n<p>The <em>args() <\/em>function returns an array containing the calling application command line arguments.<\/p>\n<p><em>args() <\/em>is called when <em>mwnci<\/em> is executed and stores the results in variables <strong><em>ARGV<\/em><\/strong> and <strong><em>ARGC<\/em><\/strong><\/p>\n<ul class=\"i8Z77e\">\n<li class=\"TrT0Xe\"><em><strong>ARGC<\/strong> <\/em>is the number of arguments on the command line (including the program name itself)<\/li>\n<li class=\"TrT0Xe\"><em><strong>ARGV<\/strong><\/em> is an array of C-style strings (character arrays) <em><strong>ARGV<\/strong><\/em>[0] is the name of the program being executed.<\/li>\n<\/ul>\n<h2>Example<\/h2>\n<pre>#!\/usr\/bin\/env mwnci\r\nprintln(\"args()=\", args())\r\nprintln(\"ARGV=\", ARGV)\r\nprintln(\"ARGC=\", ARGC)\r\n\r\n\r\n.\/args.mwnci\r\nargs()=[\".\/args.mwnci\"]\r\nARGV=[\".\/args.mwnci\"]\r\nARGC=1\r\n\r\n\r\n.\/args.mwnci arg1 arg2 three\r\nargs()=[\".\/args.mwnci\", \"arg1\", \"arg2\", \"three\"]\r\nARGV=[\".\/args.mwnci\", \"arg1\", \"arg2\", \"three\"]\r\nARGC=4\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax args() Parameters None Description The args() function returns an array containing the calling application command line arguments. args() is called when mwnci is executed and stores the results in variables ARGV and ARGC ARGC is the number of arguments on the command line (including the program name itself) ARGV is an array of C-style &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-args-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci args() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-69","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":6,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/69\/revisions"}],"predecessor-version":[{"id":1420,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/69\/revisions\/1420"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}