{"id":35253031,"url":"https://github.com/sile/noargs","last_synced_at":"2026-01-12T13:28:01.743Z","repository":{"id":284060416,"uuid":"949304931","full_name":"sile/noargs","owner":"sile","description":"Imperative command-line argument parser library for Rust with no dependencies, no macros, and no implicit I/O","archived":false,"fork":false,"pushed_at":"2026-01-10T05:40:00.000Z","size":206,"stargazers_count":27,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T01:28:05.808Z","etag":null,"topics":["command-line-parser","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-16T06:19:26.000Z","updated_at":"2026-01-10T05:39:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"a516f4de-dcc4-4517-bda3-4cd8b1bbd75c","html_url":"https://github.com/sile/noargs","commit_stats":null,"previous_names":["sile/noargs"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/sile/noargs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fnoargs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fnoargs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fnoargs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fnoargs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/noargs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fnoargs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["command-line-parser","rust"],"created_at":"2025-12-30T07:05:29.283Z","updated_at":"2026-01-12T13:28:01.730Z","avatar_url":"https://github.com/sile.png","language":"Rust","readme":"noargs\n======\n\n[![noargs](https://img.shields.io/crates/v/noargs.svg)](https://crates.io/crates/noargs)\n[![Documentation](https://docs.rs/noargs/badge.svg)](https://docs.rs/noargs)\n[![Actions Status](https://github.com/sile/noargs/workflows/CI/badge.svg)](https://github.com/sile/noargs/actions)\n![License](https://img.shields.io/crates/l/noargs)\n\n`noargs` is an imperative command-line argument parser library for Rust with no dependencies, no macros, and no implicit I/O.\n\nFeatures\n--------\n\n- Supports the following argument types:\n  - Positional arguments ([`Arg`])\n  - Named arguments with values ([`Opt`])\n  - Named arguments without values ([`Flag`])\n  - Subcommands ([`Cmd`])\n- Automatically generates help text\n- Simple and minimal interface due to its imperative nature (no complex DSL)\n\n[`Arg`]: https://docs.rs/noargs/latest/noargs/struct.Arg.html\n[`Opt`]: https://docs.rs/noargs/latest/noargs/struct.Opt.html\n[`Flag`]: https://docs.rs/noargs/latest/noargs/struct.Flag.html\n[`Cmd`]: https://docs.rs/noargs/latest/noargs/struct.Cmd.html\n\nExamples\n--------\n\n### Basic Usage\n\nThe following code demonstrates the basic usage of `noargs`:\n\n```rust\nfn main() -\u003e noargs::Result\u003c()\u003e {\n    // Create `noargs::RawArgs` having the result of `std::env::args()`.\n    let mut args = noargs::raw_args();\n\n    // Set metadata for help\n    args.metadata_mut().app_name = env!(\"CARGO_PKG_NAME\");\n    args.metadata_mut().app_description = env!(\"CARGO_PKG_DESCRIPTION\");\n\n    // Handle well-known flags\n    if noargs::VERSION_FLAG.take(\u0026mut args).is_present() {\n        println!(\"{} {}\", env!(\"CARGO_PKG_NAME\"), env!(\"CARGO_PKG_VERSION\"));\n        return Ok(());\n    }\n    noargs::HELP_FLAG.take_help(\u0026mut args);\n\n    // Handle application specific args\n    let foo: usize = noargs::opt(\"foo\")\n        .default(\"1\").take(\u0026mut args).then(|a| a.value().parse())?;\n    let bar: bool = noargs::flag(\"bar\")\n        .take(\u0026mut args).is_present();\n    let baz: Option\u003cString\u003e = noargs::arg(\"[BAZ]\")\n        .take(\u0026mut args).present_and_then(|a| a.value().parse())?;\n\n    // Check unexpected args and build help text if need\n    if let Some(help) = args.finish()? {\n        print!(\"{help}\");\n        return Ok(());\n    }\n\n    // Do application logic\n    println!(\"foo: {}, bar: {}, baz: {:?}\", foo, bar, baz);\n\n    Ok(())\n}\n```\n\n### Subcommands\n\nThe following example shows how to handle subcommands:\n\n```rust\nfn main() -\u003e noargs::Result\u003c()\u003e {\n    let mut args = noargs::raw_args();\n    args.metadata_mut().app_name = env!(\"CARGO_PKG_NAME\");\n    args.metadata_mut().app_description = env!(\"CARGO_PKG_DESCRIPTION\");\n\n    // Handle well-known flags\n    if noargs::VERSION_FLAG.take(\u0026mut args).is_present() {\n        println!(\"{} {}\", env!(\"CARGO_PKG_NAME\"), env!(\"CARGO_PKG_VERSION\"));\n        return Ok(());\n    }\n    noargs::HELP_FLAG.take_help(\u0026mut args);\n\n    // Handle subcommands\n    if noargs::cmd(\"start\")\n        .doc(\"Start the service\")\n        .take(\u0026mut args)\n        .is_present()\n    {\n        let port: u16 = noargs::opt(\"port\")\n            .short('p')\n            .default(\"8080\")\n            .take(\u0026mut args)\n            .then(|o| o.value().parse())?;\n\n        println!(\"Starting service on port {}\", port);\n    } else if noargs::cmd(\"stop\")\n        .doc(\"Stop the service\")\n        .take(\u0026mut args)\n        .is_present()\n    {\n        println!(\"Stopping service\");\n    } else if let Some(help) = args.finish()? {\n        print!(\"{help}\");\n        return Ok(());\n    }\n\n    Ok(())\n}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fnoargs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Fnoargs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fnoargs/lists"}