PageSourceSearch

https://risor.io/_next/static/chunks/pages/docs/modules/shlex-7831575bb6415173.js

js risor.io collected 2026-10-04 15:55:40 UTC 13,044 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7197],{6585:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/modules/shlex",function(){return o(2757)}])},5610:function(e,t,o){"use strict";o.d(t,{Z:function(){return r}});var s=o(5893);o(7294);var i=o(1163),a=o(9576);let n={logo:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("img",{src:"/risor-icon.svg",width:"48",height:"48",alt:"Risor Logo"}),(0,s.jsx)("span",{style:{marginLeft:"-0.3em",fontWeight:800},children:"Risor"})]}),project:{link:"https://github.com/risor-io/risor"},chat:{},docsRepositoryBase:"https://github.com/shuding/nextra-docs-template",useNextSeoProps(){let{asPath:e}=(0,i.useRouter)();return"/"!==e&&""!==e?{titleTemplate:"%s"}:{titleTemplate:"Risor"}},footer:{text:"Risor"},navbar:{},darkMode:!0,feedback:{content:null},nextThemes:{defaultTheme:"dark"},editLink:{component:function(){return(0,s.jsx)("div",{})}},primaryHue:{light:198,dark:198},sidebar:{autoCollapse:!0,defaultMenuCollapseLevel:1},head:()=>{let{asPath:e,defaultLocale:t,locale:o}=(0,i.useRouter)(),{frontMatter:n}=(0,a.ZR)(),r="https://risor.io"+(t===o?e:"/".concat(o).concat(e));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),(0,s.jsx)("meta",{property:"og:url",content:r}),(0,s.jsx)("link",{rel:"icon",type:"image/x-icon",href:"/risor-icon.svg"}),(0,s.jsx)("meta",{property:"og:title",content:n.title||"Risor"}),(0,s.jsx)("meta",{property:"og:description",content:n.description||"Fast and flexible scripting for Go developers and DevOps."})]})}};var r=n},2757:function(e,t,o){"use strict";o.r(t);var s=o(5893),i=o(1379),a=o(9576),n=o(5610);o(9966);var r=o(1151);o(5675);let d={MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:t}=Object.assign({},(0,r.ah)(),e.components);return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)},pageOpts:{filePath:"pages/docs/modules/shlex.mdx",route:"/docs/modules/shlex",headings:[{depth:1,value:"shlex",id:"shlex"},{depth:2,value:"Functions",id:"functions"},{depth:3,value:"argv",id:"argv"}],pageMap:[{kind:"Meta",data:{index:{title:"Introduction",type:"page",display:"hidden"},docs:{title:"Docs",type:"page"},examples:{title:"Examples",type:"page"},blog:{title:"Blog",type:"page",theme:{sidebar:!1}}}},{kind:"Folder",name:"blog",route:"/blog",children:[{kind:"Meta",data:{release_1_8:"Release v1.8.0",risor_opcodes:"Opcodes",release_1_4:"Release v1.4.0",hello:"Heads Up!"}},{kind:"MdxPage",name:"hello",route:"/blog/hello",frontMatter:{image:"https://assets.vercel.com/image/upload/v1670542323/swr/v2.png",description:"Hey there everyone! This project got some surprise attention ...",date:"July 25th, 2023"}},{kind:"MdxPage",name:"release_1_4",route:"/blog/release_1_4",frontMatter:{image:"https://github.com/risor-io/risor/raw/main/static/images/risor-logo-nopad.png",description:"Release v1.4.0: new keywords, HTTP servers, CLIs ...",date:"February 24th, 2024"}},{kind:"MdxPage",name:"release_1_8",route:"/blog/release_1_8",frontMatter:{image:"https://github.com/risor-io/risor/raw/main/static/images/risor-logo-nopad.png",description:"Release v1.8.0: web crawling, scheduling, QR codes, and more",date:"May 18th, 2025"}},{kind:"MdxPage",name:"risor_opcodes",route:"/blog/risor_opcodes",frontMatter:{image:"https://github.com/risor-io/risor/raw/main/static/images/risor-logo-nopad.png",description:"This post explores the Risor opcodes, compiler, and VM ...",date:"March 12, 2024"}}]},{kind:"MdxPage",name:"blog",route:"/blog",frontMatter:{title:"Blog",searchable:!1}},{kind:"Folder",name:"docs",route:"/docs",children:[{kind:"Meta",data:{index:{title:"Getting Started"},syntax:{title:"Syntax"},builtins:{title:"Builtins"},modules:{title:"Modules"},types:{title:"Types"},how_it_works:{title:"How it Works"},use_cases:{title:"Use Cases"},comparisons:{title:"Comparisons with Go"},contributing_modules:"Contributing Modules",executable_scripts:"Executable Scripts"}},{kind:"MdxPage",name:"builtins",route:"/docs/builtins"},{kind:"Folder",name:"comparisons",route:"/docs/comparisons",children:[{kind:"MdxPage",name:"golang-string-concat",route:"/docs/comparisons/golang-string-concat",frontMatter:{title:"Str
1ing Concatenation",description:"Describes multiple approaches to string concatenation in Go and Risor. This includes using the `+` operator, `+=`, `fmt.Sprintf`, `strings.Join`, `bytes.Buffer`, and `strings.Builder`."}},{kind:"MdxPage",name:"golang-string-operations",route:"/docs/comparisons/golang-string-operations",frontMatter:{title:"String Operations",description:"Describes various ways to work with strings in Go and Risor, including building multi-line strings, reading and writing files, and printing Go structs."}},{kind:"Meta",data:{"golang-string-concat":"String Concatenation","golang-string-operations":"String Operations"}}]},{kind:"MdxPage",name:"contributing_modules",route:"/docs/contributing_modules"},{kind:"MdxPage",name:"executable_scripts",route:"/docs/executable_scripts"},{kind:"MdxPage",name:"how_it_works",route:"/docs/how_it_works"},{kind:"MdxPage",name:"index",route:"/docs"},{kind:"Folder",name:"modules",route:"/docs/modules",children:[{kind:"Meta",data:{aws:{title:"aws"},base64:{title:"base64"},bcrypt:{title:"bcrypt"},bytes:{title:"bytes"},cli:{title:"cli"},color:{title:"color"},errors:{title:"errors"},exec:{title:"exec"},filepath:{title:"filepath"},fmt:{title:"fmt"},gha:{title:"gha"},goquery:{title:"goquery"},htmltomarkdown:{title:"htmltomarkdown"},http:{title:"http"},image:{title:"image"},isatty:{title:"isatty"},jmespath:{title:"jmespath"},json:{title:"json"},kubernetes:{title:"kubernetes"},math:{title:"math"},net:{title:"net"},os:{title:"os"},pgx:{title:"pgx"},playwright:{title:"playwright"},qrcode:{title:"qrcode"},rand:{title:"rand"},regexp:{title:"regexp"},sched:{title:"sched"},semver:{title:"semver"},shlex:{title:"shlex"},slack:{title:"slack"},sql:{title:"sql"},strconv:{title:"strconv"},strings:{title:"strings"},tablewriter:{title:"tablewriter"},template:{title:"template"},time:{title:"time"},uuid:{title:"uuid"},vault:{title:"vault"},yaml:{title:"yaml"}}},{kind:"MdxPage",name:"aws",route:"/docs/modules/aws"},{kind:"MdxPage",name:"base64",route:"/docs/modules/base64"},{kind:"MdxPage",name:"bcrypt",route:"/docs/modules/bcrypt"},{kind:"MdxPage",name:"bytes",route:"/docs/modules/bytes"},{kind:"MdxPage",name:"cli",route:"/docs/modules/cli"},{kind:"MdxPage",name:"color",route:"/docs/modules/color"},{kind:"MdxPage",name:"errors",route:"/docs/modules/errors"},{kind:"MdxPage",name:"exec",route:"/docs/modules/exec"},{kind:"MdxPage",name:"filepath",route:"/docs/modules/filepath"},{kind:"MdxPage",name:"fmt",route:"/docs/modules/fmt"},{kind:"MdxPage",name:"gha",route:"/docs/modules/gha"},{kind:"MdxPage",name:"goquery",route:"/docs/modules/goquery"},{kind:"MdxPage",name:"htmltomarkdown",route:"/docs/modules/htmltomarkdown"},{kind:"MdxPage",name:"http",route:"/docs/modules/http"},{kind:"MdxPage",name:"image",route:"/docs/modules/image"},{kind:"MdxPage",name:"isatty",route:"/docs/modules/isatty"},{kind:"MdxPage",name:"jmespath",route:"/docs/modules/jmespath"},{kind:"MdxPage",name:"json",route:"/docs/modules/json"},{kind:"MdxPage",name:"kubernetes",route:"/docs/modules/kubernetes"},{kind:"MdxPage",name:"math",route:"/docs/modules/math"},{kind:"MdxPage",name:"net",route:"/docs/modules/net"},{kind:"MdxPage",name:"os",route:"/docs/modules/os"},{kind:"MdxPage",name:"pgx",route:"/docs/modules/pgx"},{kind:"MdxPage",name:"playwright",route:"/docs/modules/playwright"},{kind:"MdxPage",name:"qrcode",route:"/docs/modules/qrcode"},{kind:"MdxPage",name:"rand",route:"/docs/modules/rand"},{kind:"MdxPage",name:"regexp",route:"/docs/modules/regexp"},{kind:"MdxPage",name:"sched",route:"/docs/modules/sched"},{kind:"MdxPage",name:"semver",route:"/docs/modules/semver"},{kind:"MdxPage",name:"shlex",route:"/docs/modules/shlex"},{kind:"MdxPage",name:"slack",route:"/docs/modules/slack"},{kind:"MdxPage",name:"sql",route:"/docs/modules/sql"},{kind:"MdxPage",name:"strconv",route:"/docs/modules/strconv"},{kind:"MdxPage",name:"strings",route:"/docs/modules/strings"},{kind:"MdxPage",name:"tablewriter",route:"/docs/modules/tablewriter"},{kind:"MdxPage",name:"template",route:"/docs/modules/template"},{kind:"MdxPage",name:"time",route:"/docs/modules/time"},{kind:"MdxPage",name:"uuid",route:"/docs/modules/uuid"},{kind:"MdxPage",name:"vault",route:"/docs/modules/vault"},{kind:"MdxPage",name:"yaml",route:"/docs/modules/yaml"}]},{kind:"MdxPage",name:"syntax",route:"/docs/syntax"},{kind:"Folder",name:"types",route:"/docs/types",children:[{kind:"Meta",data:{overview:{title:"Overview"},numerics:{title:"Numerics"}
1,string:{title:"String"},list:{title:"List"},map:{title:"Map"},bool:"Bool",set:"Set"}},{kind:"MdxPage",name:"bool",route:"/docs/types/bool"},{kind:"MdxPage",name:"list",route:"/docs/types/list"},{kind:"MdxPage",name:"map",route:"/docs/types/map"},{kind:"MdxPage",name:"numerics",route:"/docs/types/numerics"},{kind:"MdxPage",name:"overview",route:"/docs/types/overview"},{kind:"MdxPage",name:"set",route:"/docs/types/set"},{kind:"MdxPage",name:"string",route:"/docs/types/string"}]},{kind:"MdxPage",name:"use_cases",route:"/docs/use_cases"}]},{kind:"Folder",name:"examples",route:"/examples",children:[{kind:"Meta",data:{index:{title:"Overview",theme:{}},hello_world:"Hello World",maps:"Working with Maps",aws:"AWS SDK",pgx:"PostgreSQL",fetch:"HTTP requests"}},{kind:"MdxPage",name:"aws",route:"/examples/aws"},{kind:"MdxPage",name:"fetch",route:"/examples/fetch"},{kind:"MdxPage",name:"hello_world",route:"/examples/hello_world"},{kind:"MdxPage",name:"index",route:"/examples"},{kind:"MdxPage",name:"maps",route:"/examples/maps"},{kind:"MdxPage",name:"pgx",route:"/examples/pgx"}]},{kind:"MdxPage",name:"index",route:"/",frontMatter:{title:"Risor"}}],flexsearch:{codeblocks:!0},title:"shlex"},pageNextRoute:"/docs/modules/shlex",nextraLayout:a.ZP,themeConfig:n.Z};function l(e){let t=Object.assign({h1:"h1",p:"p",code:"code",h2:"h2",h3:"h3",pre:"pre",span:"span"},(0,r.ah)(),e.components);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{children:"shlex"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"shlex"})," module provides a shell-like argument parser."]}),"\n",(0,s.jsx)(t.p,{children:"The core functionality is provided by github.com/u-root/u-root/pkg/shlex."}),"\n",(0,s.jsx)(t.h2,{id:"functions",children:"Functions"}),"\n",(0,s.jsx)(t.h3,{id:"argv",children:"argv"}),"\n",(0,s.jsx)(t.pre,{"data-language":"go","data-theme":"default",filename:"Function signature",children:(0,s.jsx)(t.code,{"data-language":"go","data-theme":"default",children:(0,s.jsxs)(t.span,{className:"line",children:[(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-function)"},children:"argv"}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:"(s "}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-keyword)"},children:"string"}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:") []"}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-keyword)"},children:"string"})]})})}),"\n",(0,s.jsxs)(t.p,{children:["Split a command line according to usual simple shell rules. For example ",(0,s.jsx)(t.code,{children:"start --append=\"foobar foobaz\" --nogood 'food'"}),"\nwill parse into the appropriate argvs to start the command."]}),"\n",(0,s.jsx)(t.pre,{"data-language":"go","data-theme":"default",filename:"Example",children:(0,s.jsxs)(t.code,{"data-language":"go","data-theme":"default",children:[(0,s.jsxs)(t.span,{className:"line",children:[(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-keyword)"},children:">>>"}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:" shlex."}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-function)"},children:"argv"}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"start --append=\\"foobar foobaz\\" --nogood \'food\'"'}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:")"})]}),"\n",(0,s.jsxs)(t.span,{className:"line",children:[(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:"["}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"start"'}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:", "}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"--append=foobar foobaz"'}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:", "}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"--nogood"'}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:", "}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"food"'}),(0,s.jsx)(t.span,{style:{color:"var(--shiki-color-text)"},children:"]"})]})]})})]})}t.default=(0,i.j)(d)}},function(e){e.O(0,[129,9774,2888,179],function(){return e(e.s=6585)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.