Select Git revision
-
Nicolas80 authored
- Extra command `completion` added which takes a `--shell` argument to generate a completions script for a specified shell. - Adapted the Linux (amd64) build to: - generate the `gcli-completion.bash`, `gcli-completion.zsh`, `gcli-completion.fish`, `gcli-completion.ps1` completion scripts - add the `bash`, `zsh` and `fish` completion scripts in the `.deb` package - Added the ARM64 build generating a binary and a `.deb` package that also include those completion scripts.
Nicolas80 authored- Extra command `completion` added which takes a `--shell` argument to generate a completions script for a specified shell. - Adapted the Linux (amd64) build to: - generate the `gcli-completion.bash`, `gcli-completion.zsh`, `gcli-completion.fish`, `gcli-completion.ps1` completion scripts - add the `bash`, `zsh` and `fish` completion scripts in the `.deb` package - Added the ARM64 build generating a binary and a `.deb` package that also include those completion scripts.
main.rs 6.25 KiB
mod commands;
mod conf;
mod data;
mod database;
mod display;
mod entities;
mod indexer;
mod inputs;
mod keys;
mod runtime_config;
mod utils;
use anyhow::anyhow;
use clap::builder::OsStr;
use clap::{CommandFactory, Parser};
use clap_complete::{generate, Shell};
use codec::Encode;
use colored::Colorize;
use data::*;
use display::DisplayEvent;
use keys::*;
use runtime_config::*;
use serde::{Deserialize, Serialize};
use std::io;
use std::str::FromStr;
use subxt::{
blocks::ExtrinsicEvents,
config::DefaultExtrinsicParamsBuilder,
events::StaticEvent,
ext::sp_core::{sr25519, Pair as _},
tx::{DefaultPayload, PairSigner, Payload, TxStatus},
};
use utils::*;
// alias
pub type StaticPayload<Calldata> = DefaultPayload<Calldata>;
/// define command line arguments
#[derive(Clone, clap::Parser, Debug, Default)]
#[clap(author, version, about, long_about = None)]
pub struct Args {
/// Subcommands
#[clap(subcommand)]
pub subcommand: Subcommand,
/// Overwrite indexer endpoint
#[clap(short, long, conflicts_with_all=["no_indexer","network"])]
indexer: Option<String>,
/// Do not use indexer
#[clap(long)]
no_indexer: bool,
/// Secret key format (seed, substrate, g1v1)
#[clap(short = 'S', long)]
secret_format: Option<SecretFormat>,
/// Secret key or BIP39 mnemonic (only used when secret format is compatible)
/// (eventually followed by derivation path)
#[clap(short, long)]
secret: Option<String>,
/// Crypto scheme to use (sr25519, ed25519)
#[clap(short = 'c', long, required = false, default_value = CryptoScheme::Ed25519)]
crypto_scheme: CryptoScheme,
/// SS58 Address
#[clap(short, conflicts_with = "name")]
address: Option<AccountId>,
/// Name of an SS58 Address in the vault
#[clap(short = 'v')]
name: Option<String>,
/// Overwrite duniter websocket RPC endpoint
#[clap(short, long, conflicts_with = "network")]
url: Option<String>,
/// Target network (local, gdev, gtest...)