{"id":28726870,"url":"https://github.com/docopt/docopt.jl","last_synced_at":"2025-06-15T13:09:27.070Z","repository":{"id":14795736,"uuid":"17517847","full_name":"docopt/DocOpt.jl","owner":"docopt","description":"command line arguments parser","archived":false,"fork":false,"pushed_at":"2023-03-24T09:22:52.000Z","size":102,"stargazers_count":94,"open_issues_count":6,"forks_count":21,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-15T05:03:17.985Z","etag":null,"topics":["julia"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docopt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-07T15:14:05.000Z","updated_at":"2025-03-13T03:31:01.000Z","dependencies_parsed_at":"2023-02-14T20:20:47.080Z","dependency_job_id":null,"html_url":"https://github.com/docopt/DocOpt.jl","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/docopt/DocOpt.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docopt%2FDocOpt.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docopt%2FDocOpt.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docopt%2FDocOpt.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docopt%2FDocOpt.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docopt","download_url":"https://codeload.github.com/docopt/DocOpt.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docopt%2FDocOpt.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259981475,"owners_count":22941149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia"],"created_at":"2025-06-15T13:09:26.248Z","updated_at":"2025-06-15T13:09:27.054Z","avatar_url":"https://github.com/docopt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DocOpt.jl\n\n[![Build Status](https://travis-ci.org/docopt/DocOpt.jl.svg?branch=master)](https://travis-ci.org/docopt/DocOpt.jl)\n\n**DocOpt.jl** is a port of [**docopt**](http://docopt.org/) written in the [Julia](http://julialang.org/) language.\n\n**docopt** generates a command-line arguments parser from human-readable usage patterns.\n\nYou will find how attractive the idea of **docopt** is with the example below:\n\n```julia\ndoc = \"\"\"Naval Fate.\n\nUsage:\n  naval_fate.jl ship new \u003cname\u003e...\n  naval_fate.jl ship \u003cname\u003e move \u003cx\u003e \u003cy\u003e [--speed=\u003ckn\u003e]\n  naval_fate.jl ship shoot \u003cx\u003e \u003cy\u003e\n  naval_fate.jl mine (set|remove) \u003cx\u003e \u003cy\u003e [--moored|--drifting]\n  naval_fate.jl -h | --help\n  naval_fate.jl --version\n\nOptions:\n  -h --help     Show this screen.\n  --version     Show version.\n  --speed=\u003ckn\u003e  Speed in knots [default: 10].\n  --moored      Moored (anchored) mine.\n  --drifting    Drifting mine.\n\n\"\"\"\n\nusing DocOpt  # import docopt function\n\nargs = docopt(doc, version=v\"2.0.0\")\n```\n\nThe result is:\n\n```\n$ julia -qL examples/naval_fate.jl ship new FOO\njulia\u003e args\nDict{String,Any} with 15 entries:\n  \"remove\"     =\u003e false\n  \"--help\"     =\u003e false\n  \"\u003cname\u003e\"     =\u003e String[\"FOO\"]\n  \"--drifting\" =\u003e false\n  \"mine\"       =\u003e false\n  \"move\"       =\u003e false\n  \"--version\"  =\u003e false\n  \"--moored\"   =\u003e false\n  \"\u003cx\u003e\"        =\u003e nothing\n  \"ship\"       =\u003e true\n  \"new\"        =\u003e true\n  \"shoot\"      =\u003e false\n  \"set\"        =\u003e false\n  \"\u003cy\u003e\"        =\u003e nothing\n  \"--speed\"    =\u003e \"10\"\n\n```\n\nJulia v0.6 is now supported.\n\n\n## API\n\nThe `DocOpt` module exports just one function, `docopt`, which takes multiple\narguments but all of them except the first one are optional.\n\n```julia\ndocopt(doc::AbstractString, argv=ARGS; help=true, version=nothing, options_first=false, exit_on_error=true)\n```\n\n**Arguments**\n\n* `doc` : Description of your command-line interface. (type: `AbstractString`)\n* `argv` : Argument vector to be parsed. (type: `String` or `Vector{String}`, default: `ARGS`)\n* `help` : Set to `false` to disable automatic help on -h or --help options. (type: `Bool`, default: `true`)\n* `version` : If passed, the value will be printed if --version is in `argv`. (any type, but `VersionNumber` is recommended, e.g. v\"1.0.2\")\n* `options_first` : Set to `true` to require options precedes positional arguments, i.e. to forbid options and positional arguments intermix. (type: `Bool`, default: `false`)\n* `exit_on_error` : Set to `true` to print the usage and exit when parsing error happens. This option is for unit testing. (type: `Bool`, default: `true`)\n\n`doc` argument is mandatory, `argv` argument is automatically set to command-line arguments, and `help`, `version`, `options_first` and `exit_on_error` are keyword arguments.\n\n**Return**\n\n* parsed arguments : An associative collection, where keys are names of command-line elements such as e.g. \"--verbose\" and \"\u003cpath\u003e\", and values are the parsed values of those elements. (type: `Dict{String,Any}`)\n\nSee \u003chttp://docopt.org/\u003e for more details about the grammar of the usage pattern.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocopt%2Fdocopt.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocopt%2Fdocopt.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocopt%2Fdocopt.jl/lists"}