Skip to content

Commit

Permalink
Move create and list under account command
Browse files Browse the repository at this point in the history
  • Loading branch information
kent-white authored and aptos-bot committed Apr 15, 2022
1 parent de801f2 commit 8f62a12
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions crates/aptos/src/account/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0

//! A command to create a new account on-chain
//!
//! TODO: Examples
//!
use crate::common::types::CliResult;
use clap::Subcommand;

pub mod create;
pub mod list;

/// Command to create a new account on-chain
///
#[derive(Debug, Subcommand)]
pub enum AccountTool {
Create(create::CreateAccount),
List(list::ListResources),
}

impl AccountTool {
pub async fn execute(self) -> CliResult {
match self {
AccountTool::Create(tool) => tool.execute().await,
AccountTool::List(tool) => tool.execute().await,
}
}
}
10 changes: 4 additions & 6 deletions crates/aptos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

#![forbid(unsafe_code)]

pub mod account;
pub mod common;
pub mod create_account;
pub mod list;
pub mod move_tool;
pub mod op;

Expand All @@ -17,9 +16,9 @@ use clap::Parser;
#[derive(Parser)]
#[clap(name = "aptos", author, version, propagate_version = true)]
pub enum Tool {
CreateAccount(create_account::CreateAccount),
#[clap(subcommand)]
Account(account::AccountTool),
Init(common::init::InitTool),
List(list::ListResources),
#[clap(subcommand)]
Move(move_tool::MoveTool),
#[clap(subcommand)]
Expand All @@ -29,9 +28,8 @@ pub enum Tool {
impl Tool {
pub async fn execute(self) -> CliResult {
match self {
Tool::CreateAccount(tool) => tool.execute().await,
Tool::Account(tool) => tool.execute().await,
Tool::Init(tool) => tool.execute().await,
Tool::List(tool) => tool.execute().await,
Tool::Move(tool) => tool.execute().await,
Tool::Op(tool) => tool.execute().await,
}
Expand Down

0 comments on commit 8f62a12

Please sign in to comment.