{"id":20667109,"url":"https://github.com/lu-zero/arg_enum_proc_macro","last_synced_at":"2025-04-19T17:07:30.740Z","repository":{"id":57493366,"uuid":"175050457","full_name":"lu-zero/arg_enum_proc_macro","owner":"lu-zero","description":"clap.rs arg_enum made procedural","archived":false,"fork":false,"pushed_at":"2023-09-12T12:40:34.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T00:13:43.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lu-zero.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}},"created_at":"2019-03-11T17:27:32.000Z","updated_at":"2021-11-18T21:13:23.000Z","dependencies_parsed_at":"2022-08-28T15:13:03.781Z","dependency_job_id":null,"html_url":"https://github.com/lu-zero/arg_enum_proc_macro","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Farg_enum_proc_macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Farg_enum_proc_macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Farg_enum_proc_macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lu-zero%2Farg_enum_proc_macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lu-zero","download_url":"https://codeload.github.com/lu-zero/arg_enum_proc_macro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224964679,"owners_count":17399434,"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":[],"created_at":"2024-11-16T19:42:55.249Z","updated_at":"2024-11-16T19:42:55.912Z","avatar_url":"https://github.com/lu-zero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Procedural macro derive that mimics `arg_enum!` from [clap](https://clap.rs)\n\n![Crates.io](https://img.shields.io/crates/v/arg_enum_proc_macro)\n![docs.rs](https://docs.rs/mio/badge.svg)\n[![dependency status](https://deps.rs/repo/github/lu-zero/arg_enum_proc_macro/status.svg)](https://deps.rs/repo/github/lu-zero/arg_enum_proc_macro)\n\n## Usage\n\nIn `Cargo.toml`:\n``` toml\n[dependencies]\narg_enum_proc_macro = \"0.3\"\n```\n\nIn the rust code:\n``` rust\nuse arg_enum_proc_macro::ArgEnum;\n\n/// All the possible states of Foo\n#[derive(ArgEnum)]\npub enum Foo {\n    /// Initial state\n    Unk,\n    /// Foo is on\n    On,\n    /// Foo is off\n    Off,\n}\n```\n\n### Aliases\n\nIt is possible to express an alias using the attribute `arg_enum(alias = \"AliasVariant\")`.\nThe `FromStr` will map the \"AliasVariant\" string to the decorated enum variant:\n\n``` rust\n/// All the possible states of Foo\n#[derive(ArgEnum)]\npub enum Foo {\n    /// Initial state\n    Unk,\n    /// Foo is on\n    #[arg_enum(alias = \"Up\")]\n    On,\n    /// Foo is off\n    #[arg_enum(alias = \"Down\")]\n    Off,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Farg_enum_proc_macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flu-zero%2Farg_enum_proc_macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flu-zero%2Farg_enum_proc_macro/lists"}