]>
git.proxmox.com Git - rustc.git/blob - vendor/clap_derive/src/dummies.rs
1 //! Dummy implementations that we emit along with an error.
3 use proc_macro2
::Ident
;
7 pub fn parser(name
: &Ident
) -> proc_macro2
::TokenStream
{
8 let into_app
= into_app(name
);
10 impl clap
::Parser
for #name {}
16 pub fn into_app(name
: &Ident
) -> proc_macro2
::TokenStream
{
18 impl clap
::CommandFactory
for #name {
19 fn command
<'b
>() -> clap
::Command
{
22 fn command_for_update
<'b
>() -> clap
::Command
{
30 pub fn from_arg_matches(name
: &Ident
) -> proc_macro2
::TokenStream
{
32 impl clap
::FromArgMatches
for #name {
33 fn from_arg_matches(_m
: &clap
::ArgMatches
) -> ::std
::result
::Result
<Self, clap
::Error
> {
36 fn update_from_arg_matches(&mut self, matches
: &clap
::ArgMatches
) -> ::std
::result
::Result
<(), clap
::Error
>{
44 pub fn subcommand(name
: &Ident
) -> proc_macro2
::TokenStream
{
45 let from_arg_matches
= from_arg_matches(name
);
47 impl clap
::Subcommand
for #name {
48 fn augment_subcommands(_cmd
: clap
::Command
) -> clap
::Command
{
51 fn augment_subcommands_for_update(_cmd
: clap
::Command
) -> clap
::Command
{
54 fn has_subcommand(name
: &str) -> bool
{
63 pub fn args(name
: &Ident
) -> proc_macro2
::TokenStream
{
64 let from_arg_matches
= from_arg_matches(name
);
66 impl clap
::Args
for #name {
67 fn augment_args(_cmd
: clap
::Command
) -> clap
::Command
{
70 fn augment_args_for_update(_cmd
: clap
::Command
) -> clap
::Command
{
79 pub fn value_enum(name
: &Ident
) -> proc_macro2
::TokenStream
{
81 impl clap
::ValueEnum
for #name {
82 fn value_variants
<'a
>() -> &'a
[Self]{
85 fn from_str(_input
: &str, _ignore_case
: bool
) -> ::std
::result
::Result
<Self, String
> {
88 fn to_possible_value
<'a
>(&self) -> ::std
::option
::Option
<clap
::builder
::PossibleValue
>{