Update clap to 4.0.0

This commit is contained in:
Andrey Golovizin 2022-09-28 11:34:42 +02:00
parent 97215faa9c
commit 0ecb11ea7b
3 changed files with 14 additions and 44 deletions

View file

@ -4,20 +4,20 @@ use std::process;
use log::debug;
use clap::Parser;
use clap::{Parser, Subcommand};
use serde::{Deserialize, Serialize};
const BASE_URL: &str = "https://api.azirevpn.com/v1";
/// AzireVPN client
#[derive(Parser, Debug)]
#[clap(version)]
#[command(version)]
struct Opts {
/// Enables JSON output
#[clap(short, long)]
#[arg(short, long)]
json: bool,
#[clap(subcommand)]
#[command(subcommand)]
command: Command,
}
@ -27,14 +27,14 @@ struct ConfigOpts {
username: String,
token: String,
#[clap(short, long)]
#[arg(short, long)]
no_dns: bool,
#[clap(short = '4', long)]
#[arg(short = '4', long)]
no_ipv6: bool,
}
#[derive(Parser, Debug)]
#[derive(Subcommand, Debug)]
enum Command {
/// Prints the list of VPN endpoints
Endpoints,