Skip to content
Snippets Groups Projects
Select Git revision
  • bc7401622a8f9dc735c5d34beeb8b62fbf103c93
  • master default protected
  • json-output
  • nostr
  • 48-error-base-58-requirement-is-violated
  • no-rename
  • hugo/tx-comments
  • poka/dev
  • hugo/dev
  • tuxmain/mail
  • 0.4.3-RC2
  • 0.4.3-RC1
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.0
  • 0.2.17
  • 0.2.16
  • 0.2.15
  • 0.2.14
  • 0.2.13
  • 0.2.12
  • 0.2.10
  • 0.2.9
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
30 results

main.rs

Blame
    • Nicolas80's avatar
      bc740162
      gcli command auto completion and arm64 build · bc740162
      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.
      bc740162
      History
      gcli command auto completion and arm64 build
      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...)